title: Get the attributes of a particular tag from the XML file
body: <p>I am trying to parse the XML file to get the attributes of a particular tag. Below is my XML file-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;app hash='nv' name='Tech' package='1.0' version='13' filesize='200' create_date='01-03-1987' upate_date='07-09-2013' &gt;
      &lt;url&gt;
          &lt;name&gt;RJ&lt;/name&gt;
          &lt;score&gt;10&lt;/score&gt;
      &lt;/url&gt;
      &lt;url&gt;
          &lt;name&gt;ABC&lt;/name&gt;
          &lt;score&gt;20&lt;/score&gt;
      &lt;/url&gt;
  &lt;/app&gt;
  </code></pre>
  
  <p>I am trying to get hash, name, package, version, filesize, create_date, update_date value from the above XML file.</p>
  
  <p>Below is my code in which I am trying to parse the above XML file but I am not sure how to get the above required attributes from the <code>app</code> tag?</p>
  
  <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
  try {
  
      InputStream is = request.getInputStream();
      Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
      doc.getDocumentElement().normalize();
  
      System.out.println("root of xml file" + doc.getDocumentElement().getNodeName());
  
      //get hash, name, package value from the app tag in the XML file
  
      } catch (Exception e) {
        System.out.println(e);
      }
  </code></pre>
  
  <p>Can anyone please help me with this?</p>