title: Getting specific Node Value from XML and add to ArrayLIst
body: <p>I have an XML like this </p>
  
  <pre><code>&lt;reg&gt;
    &lt;user&gt;
         &lt;Name&gt; abc&lt;/Name&gt;
         &lt;Email&gt; abc@xyz.com&lt;/Email&gt;
         &lt;picture&gt; sdCard/imges.145.jpg &lt;/Picture&gt;
         &lt;Date&gt; 12/12/2012&lt;/Date&gt;
    &lt;/user&gt;
    &lt;user&gt;
         &lt;Name&gt; abc dfg&lt;/Name&gt;
         &lt;Email&gt; ertdg@xyz.com&lt;/Email&gt;
         &lt;picture&gt; sdCard/imges.145.jpg &lt;/Picture&gt;
         &lt;Date&gt; 23/12/2013&lt;/Date&gt;
    &lt;/user&gt;
  &lt;/reg&gt;
  </code></pre>
  
  <p>i want to get values of specific nodes and add them to ArrayList to show the in ListView
  I have tried this code but it only gives values for Last Record</p>
  
  <pre><code>Users setUser = new Users();
  final ArrayList&lt;Users&gt; uData = new ArrayList&lt;Users&gt;();
  Document xmlDocument = builder.parse(file);
  
                  XPath xPath =  XPathFactory.newInstance().newXPath();
  
  
                  String expression = "/reg/user/Name";
                  System.out.println(expression);
  
                  NodeList nodeList = (NodeList) xPath.compile(expression).evaluate(xmlDocument, XPathConstants.NODESET);
                  for (int i = 0; i &lt; nodeList.getLength(); i++) {
                      System.out.println(nodeList.item(i).getTextContent());
                     setUser.setName(nodeList.item(i).getTextContent());
  
                 }
                  String expression1 = "/reg/user/Email";
                  System.out.println(expression1);
  
                NodeList nodeList1 = (NodeList) xPath.compile(expression1).evaluate(xmlDocument, XPathConstants.NODESET);
                  for (int i = 0; i &lt; nodeList1.getLength(); i++) {
                      System.out.println(nodeList1.item(i).getTextContent());
                     setUser.setEmail(nodeList1.item(i).getTextContent());
                 }
                  String expression2 = "/reg/user/Picture";
                  System.out.println(expression2);
  
                  NodeList nodeList2 = (NodeList) xPath.compile(expression2).evaluate(xmlDocument, XPathConstants.NODESET);
                  for (int i = 0; i &lt; nodeList2.getLength(); i++) {
                      System.out.println(nodeList2.item(i).getTextContent());
                     setUser.setimage(nodeList2.item(i).getTextContent());
                 }
                  String expression3 = "/reg/user/LastEdited";
                  System.out.println(expression3);
  
                  NodeList nodeList3 = (NodeList) xPath.compile(expression3).evaluate(xmlDocument, XPathConstants.NODESET);
                  for (int i = 0; i &lt; nodeList3.getLength(); i++) {
                      System.out.println(nodeList3.item(i).getTextContent());
                     setUser.setDate(nodeList3.item(i).getTextContent()); 
  
  
                  }  uData.add(setUser);
  </code></pre>
  
  <p>How can i make this to show all records ?</p>