The XML module of the DataType Utility allows you to take an XML document and convert it to a string.

{{>datatype-xmlformat-source}}

To output an XML document as a string, simply call the format() function of the Y.XML class:

``` YUI().use("datatype-xml", function(Y) { var xmlString = '' + '' + 'Abc' + '1' + '' + '' + 'Def' + '2' + '' + '' + 'Ghhi' + '3' + '' + ''; var myXMLDoc = Y.XML.parse(xmlString); alert(Y.XML.format(myXMLDoc)); }); ```