title: StAX - Is it possible to convert an XML node to HashMap (OR POJO class with a hashmap)
body: <p>I am using Streaming XML API for parsing a huge XML file (size~10 M, #objects ~ 100K)..</p>
  
  <p>Is it possible to convert an XML node like - </p>
  
  <pre><code>&lt;A&gt;
  &lt;C&gt;b &lt;/C&gt;
  &lt;D&gt;c &lt;/D&gt;
  &lt;E&gt;d &lt;/E&gt;
  &lt;F&gt;e &lt;/F&gt;
  &lt;G&gt;f &lt;/G&gt;
  &lt;/A&gt;
  </code></pre>
  
  <p>to a Java HashMap? Or a POJO class with HashMap as the only member.. such that this hashmap contains all name-value pairs..</p>
  
  <p>EDIT - I need to use Streaming API for parsing XML. I want to do something like this - </p>
  
  <pre><code>//reach a start element
  while(reader.isStartElement());
  //until u reach end element
  'XMLNode' value = getNodeValue(reader);
  //convert XMLNode to POJO
  
  //getNodeValue looks like this
  while(reader.isEndElement()) {
      //read file
      //collect all characters until end element 
  }
  //produce XMLNode 
  </code></pre>