title: Read XML file into hashmap and create new object
body: <p>I am trying to read XML into a <code>HashMap</code>, I am trying to read each XML node and create new object based on its contents. </p>
  
  <p>How do I retrieve the value of each node of the XML? </p>
  
  <p>For example : I need to retrieve <code>birthdate</code> value within my for loop and use it to create a new <code>studentInfo</code> object.</p>
  
  <p>xml : </p>
  
  <pre><code>&lt;students xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="students.xsd"&gt;&lt;description&gt;A bunch students and courses&lt;/description&gt;&lt;student studentID="0144085" gender ="M"&gt;&lt;firstname&gt;Jack&lt;/firstname&gt;
    &lt;lastname&gt;Blogs&lt;/lastname&gt; &lt;birthday day="21" month="04" year="1983"/&gt;&lt;paper&gt;Data Structures and Algorithms&lt;/paper&gt;&lt;paper&gt;Distributed and Mobile Systems&lt;/paper&gt;     &lt;paper&gt;Software Engineering&lt;/paper&gt;&lt;paper&gt;Highly Secure Systems&lt;/paper&gt;&lt;paper&gt;Engineering Computations&lt;/paper&gt;&lt;paper&gt;Object Oriented Programming&lt;/paper&gt;&lt;/student&gt;
  </code></pre>
  
  <p>code : </p>
  
  <pre><code>                //jf : set StudentINfoSet class properties
              this.description =  rootXMLNode.getElementsByTagName( "description" ).item( 0 ).getTextContent();
              studentMap =  new HashMap&lt;String, StudentInfo&gt;();
              NodeList nodeList = document.getElementsByTagName( "student" );
              for (int i = 0; i &lt; nodeList.getLength(); i++) {
                  Node currentNode = nodeList.item(i);
                  StudentInfo si = new StudentInfo(Integer.toString(i)){};
                  /*
                   * String studentID, String firstName, String lastName,
          String birthdate, String gender, char studentGender
                   * */
                  this.studentMap.put(Integer.toString(i), si);
              }
              System.out.println("Number of students : "+nodeList.getLength());
  </code></pre>