title: How can I extract data from an XML file using Java?
body: <p>My XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;devices&gt;
   &lt;device mobile="true" supported="false"&gt;Windows CE&lt;/device&gt;
   &lt;device mobile="false" minVersion="2"&gt;Firefox&lt;/device&gt;
   &lt;device mobile="false" minVersion="3"&gt;Safari&lt;/device&gt;
   &lt;device mobile="false" minVersion="6"&gt;MSIE&lt;/device&gt;
   &lt;device mobile="false" minVersion="1"&gt;Chrome&lt;/device&gt;
  &lt;/devices&gt;
  </code></pre>
  
  <p>From Java, if we give input as "Firefox", the output should be mobile=false and minversion=2.</p>
  
  <p>How can I get this data from the XML using Java?</p>