title: Parsing XML data using google script
body: <p>I have been trying to convert a xml feed into human readable form but have not succeeded . I have tried seeing the example given in tutorails section but its too complex. Please can someone help me out with what is to be done. I can do fine till parsing of xml.</p>
  
  <p>I am using google script and the output has to be in google docs.</p>
  
  <p>here is what i came up with till now</p>
  
  <pre><code>    var response = UrlFetchApp.fetch("http://getRecords.php?oauth_token=3e73c7&amp;lat="+lat+"&amp;lon="+lon+"&amp;searchFor="+text+"&amp;miles=100&amp;response_type=xml");
  
    var doc = Xml.parse(response.getContentText(), true)
   var root = doc.getElement();
   var entryList = "&lt;ul&gt;\n";
  
   var entries = root.getElements("details");
  
    for (var i=0; i&lt;entries.length; i++) {
    var e = entries[i];
    var name = e.getElement("name").getText();
  
    }
  
  
  
     entryList += "&lt;li&gt;name &lt;/li&gt;" + name;
  
  
     entryList += "&lt;/ul&gt;\n";
     return entryList;  
  </code></pre>
  
  <p>Here is the xml </p>
  
  <pre><code>&lt;record&gt;
  &lt;details&gt;
  &lt;id&gt;212929&lt;/id&gt;
  &lt;distance&gt;0&lt;/distance&gt;
  &lt;category cat="8" sub="202" id="1201"&gt;General&lt;/category&gt;
  &lt;name&gt;Text Book Center&lt;/name&gt;
  &lt;short_desc&gt;One of Kenya's finest&lt;/short_desc&gt;
  &lt;long_desc&gt;
  One of Kenya's leading bookshops, the Text Book Center offers a wide selection of titles. There is everything here from textbooks to fiction to the latest Information Technology titles. The range of maps is especially impressive. The shop is spacious and cool, giving shoppers plenty of room to browse the shelves upon shelves of books. Look out for the regular special offers.
  &lt;/long_desc&gt;
  &lt;address&gt;
  &lt;address1&gt;Kijabe Street&lt;/address1&gt;
  &lt;city&gt;Nairobi&lt;/city&gt;
  &lt;country&gt;Kenya&lt;/country&gt;
  &lt;latitude&gt;0&lt;/latitude&gt;
  &lt;longitude&gt;0&lt;/longitude&gt;
  &lt;/address&gt;
  &lt;neighborhood&gt;Downtown&lt;/neighborhood&gt;
  &lt;phone&gt;+254 2 330 340&lt;/phone&gt;
  &lt;email&gt;info@tbc.co.ke&lt;/email&gt;
  &lt;open_hours&gt;8am-1pm; 2pm-5.30pm Mon-Sat.&lt;/open_hours&gt;
  &lt;/details&gt;
  &lt;/record&gt;
  &lt;/records&gt;
  </code></pre>
  
  <p>how do i remove the tags and just print it out in docs. Please help</p>
  
  <p>thanks</p>