  <Query <%= @name %>>
    Statement "<%= @statement %>"
<% if @params -%>
<% @params.each do |param| -%>
    Param "<%= param %>"
<% end -%>
<% end -%>
<% if @minversion -%>
    MinVersion <%= @minversion %>
<% end -%>
<% if @maxversion -%>
    MaxVersion <%= @maxversion %>
<% end -%>
<% @results.each do |result| -%>
      <Result>
        Type "<%= result['type'] %>"
<% if result['instanceprefix'] -%>
        InstancePrefix "<%= result['instanceprefix'] %>"
<% end -%>
<% if result['instancesfrom'] -%>
        InstancesFrom "<%= result['instancesfrom'] %>"
<% end -%>
        ValuesFrom "<%= result['valuesfrom'] %>"
      </Result>
<% end -%>
  </Query>
