XMLDocument.rootFor()

Retrieves root node for XML Document. Given an XML Document, this method returns the node containing the root of the xml tree. The example below, shows how to add nodes to the root xml tree node. xmlDoc = XMLDocument() initialize xmlDoc using content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><invoice></invoice>" // ==================================================== // Adding several child nodes to the root xmlNode = rootFor(xmlDoc) xmlNode2 = addChildFor(xmlNode, tag : "date") xmlNode2.text = "May 26, 2005" xmlNode2 = addChildFor(xmlNode, tag : "customer") xmlNode2.text = "Peter"