title: How to convert multiple POJOs to xml in required format?
body: <p>We've requirement where we need to generate XML file for sending it to another system. I was looking at this example (which uses JAXB).</p>
  
  <p><a href="http://thomassundberg.wordpress.com/2010/01/19/how-to-convert-a-pojo-to-xml-with-jaxb/" rel="nofollow">http://thomassundberg.wordpress.com/2010/01/19/how-to-convert-a-pojo-to-xml-with-jaxb/</a></p>
  
  <p>However, this one converts only single POJO to xml whereas we have multiple POJOs e.g. Car/Wheel/Seats etc. that should appear in xml. </p>
  
  <p>Any idea on how this can be achieved?</p>
  
  <p>e.g. I would like to have something like this as final output</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;car registration="abc123"&gt;
      &lt;brand&gt;Volvo&lt;/brand&gt;
      &lt;description&gt;Sedan&lt;/description&gt;
  
      &lt;wheel&gt;
        &lt;brand&gt;Ceat&lt;/brand&gt;     
      &lt;/wheel&gt;
  &lt;/car&gt;
  </code></pre>