title: Get attribute id value from a xml in android
body: <p>please help me to parse the xml with attributes from the given xml.. </p>
  
  <pre><code> &lt;tarifs&gt;
  &lt;tarif type="internet" name="ОнЛайм 4" price="300" speedin="4" speedout="2"/&gt;
  &lt;tarif type="internet" name="ОнЛайм 10" price="400" speedin="10" speedout="5"/&gt;
  &lt;tarif type="internet" name="ОнЛайм 20" price="500" speedin="20" speedout="10"/&gt;
  &lt;/tarifs&gt;
  </code></pre>
  
  <p>I have treid this</p>
  
  <pre><code>NodeList node = element.getElementsByTagName("tarif");
  for (int j = 0; j &lt; node.getLength(); j++) {                        
      initialValues.put(TRAILER_ID, j);                   
      initialValues.put(TRAILER_TITLE, node.item(j).ATTRIBUTE_NODE.getNamedItem("name").nodeValue);
  }
  </code></pre>
  
  <p>But its not working for me.. PLease anyone help me to solve this</p>
  
  <p>Thanks in advance</p>