title: Groovy: Adding attributes and namespace to the xml
body: <p>I am building Xml building with Closures like this:</p>
  
  <pre><code>def buildRequestXml {
   def RequestXml{  //add namespace and version attribute on root
     FirstName("Name1")
     LastName("Name2")
     DOB("12/19/1983") //add attribute format="mm/dd/yyyy"
   }
   return new StreamingMarkupBuilder().bind(RequestXml)
  }
  </code></pre>
  
  <p>How would I do it?</p>