err why not use the XML com object?
code:
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.load("filename of xml here");
//create the element to be added
var toAdd = xml.createElement("test");
//add a message to it
toAdd.appendChild(xml.createTextNode("testing this"));
//add it into our xml
xml.getElementsByTagName("Messages")[0].appendChild(toAdd);
//save our xml
xml.save("filename of xml here");