Create a simple DOM and having it serialize to:

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

docNode = com.mathworks.xml.XMLUtils.createDocument('root');
docRootNode = docNode.getDocumentElement;
thisElement = docNode.createElement('element'); 
thisElement.appendChild(docNode.createTextNode('Some text here'));
docRootNode.appendChild(thisElement);
 