title: Android - Parsing Custom XML File Format into string
body: <p>I have an xml file with a custom format which I am trying to store in a string.  I am still a beginner with java and have search the forums, but the xml questions asked already appear to relate to xml formats in standard xml  format.</p>
  
  <p>The xml format I have to work with is as follows:</p>
  
  <pre><code>&lt;playList baseUrl= "Webaddress"
  &lt;file name="xxxxxxx.xxx" showTime="YYYY-MM-DD HH:MM" /&gt;
  &lt;file name="xxxxxxx.xxx" showTime="YYYY-MM-DD HH:MM" /&gt;
  .......
  &lt;/playList&gt;
  </code></pre>
  
  <p>I've been trying the sample code for XML parsing, but this is set for particular.  I've been trying for hours to overcome this, but I'm stuck even trying to pull in the string into my code.</p>
  
  <p>I have been looking at the tutorial here <a href="http://www.androidhive.info/2011/11/android-xml-parsing-tutorial/" rel="nofollow">http://www.androidhive.info/2011/11/android-xml-parsing-tutorial/</a> but I'm still stuck importing the xml file.  I believe it is with the hashmap code as my xml format doesn't match the standard tags &lt;> &lt;>.</p>
  
  <p>Here is the code I have at present:</p>
  
  <pre><code>static final String KEY_ITEM ="playlist";
  static final String KEY_NAME = "name";
  static final String KEY_DESC = "showTime";
  
  
      XMLParser parser = new XMLParser();
      String xml = parser.getXmlFromUrl(URL); // getting XML
      Document doc = parser.getDomElement(xml); // getting DOM element
  
      NodeList nl = doc.getElementsByTagName(KEY_ITEM);
  
  
      // looping through all item nodes &lt;item&gt;
      for (int i = 0; i &lt; nl.getLength(); i++) {
          // creating new HashMap
          HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
          Element e = (Element) nl.item(i);
          map.put(KEY_COST, getString(e))
          // adding each child node to HashMap key =&gt; value
          map.put(KEY_NAME, parser.getValue(e, KEY_NAME));
          map.put(KEY_DESC, parser.getValue(e, KEY_DESC));
  
          // adding HashList to ArrayList
          menuItems.add(map);
  </code></pre>
  
  <p>Any help or assistance would be greatly appreciated.  </p>
  
  <p>Thanks,</p>