title: XML parsing using DOM in java
body: <pre><code>&lt;tree&gt;
  &lt;declarations&gt;
      &lt;attributeDecl name="name" type="String"/&gt;
  &lt;/declarations&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Malaria"/&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Excess Stool"/&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Do you have watery stool"/&gt;
  &lt;branch&gt;
  &lt;/branch&gt;
  &lt;attribute name="name" value="Do you have this condition for more than a weeks time"/&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="No"/&gt;
  &lt;/branch&gt;
  &lt;/branch&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="No"/&gt;
  &lt;/branch&gt;
  &lt;/branch&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="High Fever"/&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Was your peak temperature greater than 104"/&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Do you have high fever for more than a weeks time "/&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Do you have chills"/&gt;
  &lt;/branch&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="No"/&gt;
  &lt;/branch&gt;
  &lt;/branch&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="No"/&gt;
  &lt;/branch&gt;
  &lt;/branch&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="No"/&gt;
  &lt;/branch&gt;
  &lt;/branch&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Bodyache"/&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Do you have pain in the left part of the head "/&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Do you have headache more than 5 times a day "/&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="Duration of the headache spans for more than a day "/&gt;
  &lt;/branch&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="No"/&gt;
  &lt;/branch&gt;
  &lt;/branch&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="No"/&gt;
  &lt;/branch&gt;
  &lt;/branch&gt;
  &lt;branch&gt;
  &lt;attribute name="name" value="No"/&gt;
  &lt;/branch&gt;
  &lt;/branch&gt;
  &lt;/branch&gt;
  &lt;/tree&gt;
  </code></pre>
  
  <p>I have to parse this xml .I am using DOM parser to parse the same .Since attribute name is always name in this case , i am bit clueless as in how to parse the xml .</p>