Create a simple DOM and having it serialize to:

 <?xml version="1.0" ?>
 <root>
     <element>
         Some text here
     </element>
 </root>

-- create an XML document
doc = newObject("XML", "<?xml version='1.0' ?>")
 
root = doc.createElement("root")  
doc.appendChild(root)
 
element = doc.createElement("element")
root.appendChild(element)
 
textNode = doc.createTextNode("Some text here")
element.appendChild(textNode)
 
put doc.toString()
-- "<?xml version='1.0' ?><root><element>Some text here</element></root>"