Contoh String XML yang digunakan :
var xmlstring = ‘<?xml version="1.0"?>\
<root>\
<data>\
<row>\
<cell>Captain</cell>\
<cell>Bryophyllum</cell>\
<cell>Zucchini</cell>\
</row>\
</data>\
</root>’;
<root>\
<data>\
<row>\
<cell>Captain</cell>\
<cell>Bryophyllum</cell>\
<cell>Zucchini</cell>\
</row>\
</data>\
</root>’;
Convert String to XML menggunakan Javascript:
var xmlobject = (new DOMParser()).parseFromString(xmlstring, “text/xml”);
Convert XML to String menggunakan Javascript:
var string = (new XMLSerializer()).serializeToString(xmlobject);
As Presented in captain.at


















This works only for Firefox, not for IE. Another limitation is that this only works on a full xml document, not on an xml element in the tree of an xml document