title: PhoneGap - How to parse an xml string using javascript
body: <p>I'm developing an application in phone gap. In this i've to parse an xml to get the data and display in my app. 
  Below I've given the XML from which I've to get data.</p>
  
  <pre><code>&lt;Result&gt;
  &lt;Art Transaction="event/listAllUsersXml" Success="True"/&gt;
  &lt;ExhibitorAndSponsor UserID="60" UserName="Economy Times" UserPhoto="http://www.bestbusinessplaces.com/event/admin/logos/big/100X100.gif" Latitude="" Longitude="" Country="" UserType="SponsorAndExhibitor"/&gt;
  &lt;ExhibitorAndSponsor UserID="61" UserName="Cadbury" UserPhoto="http://www.bestbusinessplaces.com/event/admin/logos/big/100X100.gif" Latitude="" Longitude="" Country="Andorra" UserType="SponsorAndExhibitor"/&gt;
  &lt;ExhibitorAndSponsor UserID="62" UserName="Pepsi" UserPhoto="http://www.bestbusinessplaces.com/event/admin/logos/big/100X100.gif" Latitude="" Longitude="" Country="" UserType="SponsorAndExhibitor"/&gt;
  &lt;/Result&gt;
  </code></pre>
  
  <p>So can anyone tell me how to get the data from the xml string.</p>
  
  <p>Thanks in Advance</p>
  
  <hr>
  
  <pre><code>function displayData(){
              UserID = (x[i].getElementsByTagName("UserID")[0]);
              UserName = (x[i].getElementsByTagName("UserName")[0]);
              UserType = (x[i].getElementsByTagName("UserType")[0]);
              txt = "UserID: " + UserID + "&lt;br /&gt;UserName: " + UserName + "&lt;br /&gt;UserType: "+ UserType;
              document.getElementById("showCD").innerHTML = txt;
          }
  </code></pre>
  
  <p>//</p>
  
  <p>i'm using this code to get the value from the xml. But the value in i've get is nothing(Undefined).</p>