title: Complex JAXB unmarshalling into more than object
body: <p>I am new to JAXB and am currently working on a project which requires unmarshalling a complex XML in to more than one nested objects. For example suppose I have following XML</p>
  
  <pre class="lang-xml prettyprint-override"><code> &lt;person&gt;
       &lt;bio&gt;
            &lt;id&gt;12345&lt;/id&gt;
            &lt;name&gt;Keth TTT&lt;/name&gt;
            &lt;age&gt;30&lt;/age&gt;
       &lt;/bio&gt;
       &lt;address&gt;
             &lt;no&gt;1232&lt;/no&gt;
             &lt;street&gt;York Street&lt;/street&gt;
             &lt;city&gt;NewYork&lt;city&gt;
             &lt;country&gt;USA&lt;/country&gt;
       &lt;/address&gt;
   &lt;/person&gt;
  </code></pre>
  
  <p>and suppose i have following domain objects</p>
  
  <pre class="lang-java prettyprint-override"><code>class Person{
      String id;
      String name;
      int age;
      Address address;
  }
  </code></pre>
  
  <p>and </p>
  
  <pre class="lang-java prettyprint-override"><code>class Address{
      String name;
      String no;
      String street;
      String city;
      String country;
  }
  </code></pre>
  
  <p>If the XSD is mtaching or have the matching structure, JAXB will easily populate those POJOs. But in here we need to do complex mapping(Ex: both <code>Person</code> and <code>Address</code> classes contain same attribute name). How can we travel through these objects and populate both objects?</p>