title: Convert XML to Map of nested maps
body: <p>I have an XML with nested elements and repeating tags. For example:</p>
  
  <pre><code>&lt;person&gt;
      &lt;name&gt;Rama&lt;/name&gt;
      &lt;age&gt;27&lt;/age&gt;
      &lt;gender&gt;male&lt;/gender&gt;
      &lt;address&gt;
          &lt;doornumber&gt;234&lt;/doornumber&gt;
          &lt;street&gt;Kanon&lt;/street&gt;
          &lt;city&gt;Hyderabad&lt;/city&gt;
      &lt;/address&gt;
      &lt;qualification&gt;
          &lt;degree&gt;M.Sc&lt;/degree&gt;
          &lt;specialisation&gt;Maths&lt;/specialisation&gt;
      &lt;/qualification&gt;
      &lt;qualification&gt;
          &lt;degree&gt;B.E.&lt;/degree&gt;
          &lt;specialisation&gt;Electrical&lt;/specialisation&gt;
      &lt;/qualification&gt;
  &lt;/person&gt;
  </code></pre>
  
  <p>Now I want an API which will convert this XML into a Map of Maps in Java:</p>
  
  <pre><code>{name="Rama",age="27",gender="male",address={doornumber=234,street="Kanon",city="Hyderabad"},qualification=[{degree="M.Sc",specialisation="Maths"},{degree="B.E.",specialisation="Electrical"}]}
  </code></pre>
  
  <p>I know that we can use XStream API to achieve this. Here I just wanted to know if using XStream has any downsides and whether there exists any other better Java API for achieving this. Any suggestions?</p>
  
  <p>Note: This should be done in a generic way i.e. the Java API should be applicable to any XML, not just to the above XML.</p>