Comparing AjxXmlDoc and AjxSoapDoc, I have added 3 functions to AjxXmlDoc that I beleive could come in handy for people wanting to handle simple xml documents with the AjxXmlDoc class:

Code:
AjxXmlDoc.prototype.set =
function(name, value, element) {
   var p = this._doc.createElement(name);
      if (value != null) {
         var cdata = this._doc.createTextNode("");
         p.appendChild(cdata);
         cdata.nodeValue = value;
      }
      if (element == null) {
         this.root.appendChild(p);
      } else {
         element.appendChild(p);
      }
   return p;
}

AjxXmlDoc.prototype.getDocXml =
function() {
   if (AjxEnv.isSafari)
      return AjxXmlDoc.getXml(this.getDoc());
   else
      return this.getDoc().xml;
}

AjxXmlDoc.createRoot =
function(rootName) {
   var xmldoc = AjxXmlDoc.create();
   var d = xmldoc.getDoc();
   xmldoc.root = d.createElement(rootName);

   d.appendChild(xmldoc.root);
   return xmldoc;
}
Below is an example of how to use this code:
Code:
   var xmlDoc = AjxXmlDoc.createRoot("GetMenuItems");
   xmlDoc.set("pageID", "4");
   xmlDoc.set("type", "content_container");
   xmlDoc.set("parentID", "1");
The above code produces the following document:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<GetMenuItems>
   <pageID>4</pageID>
   <type>content_container</type>
   <parentID>1</parentID>
</GetMenuItems>
Would you be willing to integrate this extra code in the next release ?

Heladito