title: Groovy XML MarkupBuilder does not create root <?xml .... ?>
body: <p>I am using XML MarkupBuilder to generate XML files</p>
  
  <pre><code>import groovy.xml.StreamingMarkupBuilder
  import groovy.xml.MarkupBuilder
  import org.custommonkey.xmlunit.*
  
  ....
  
  def xmlObj = new StringWriter()
  def xml = new MarkupBuilder(xmlObj)
  xml.book("id":21){
      name('bookname')
  }
  </code></pre>
  
  <p>and I get the output:</p>
  
  <pre><code>&lt;book id='21'&gt;
      &lt;name&gt;bookname&lt;/name&gt;
  &lt;/book&gt;
  </code></pre>
  
  <p>how can I make it generate the root xml tag as well?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>