function SimpleXmlParser(xmlDoc) { // (1) pass in the DOMDocument (either created manually or from an XMLHttpRequest.responseXML)
  this.xmlDoc = xmlDoc; 
}

SimpleXmlParser.prototype.getItems = function(key) {
  var xmlDoc = this.xmlDoc;
  var items = [];
     var objNodeList = xmlDoc.getElementsByTagName(key); // (3) get the specific tags the user wants
     for (var i = 0; i < objNodeList.length; ++i) {
       var xmlItem = objNodeList.item(i);
       var item = {};
       var added = false;
       for (var j = 0; j < xmlItem.childNodes.length; ++j) {
         var child = xmlItem.childNodes.item(j);
         if (child.childNodes.length > 0) { // (4) pull out the text for the children of the main tag
           var name = child.nodeName;
           var value = child.childNodes[0].nodeValue;
           item[name] = value;
           added = true;
         }

       }
       if (added) {
         items.push(item);     
       }
     }
  return items;
}
