class XMLSource extends MovieClip { var text; var data; function XMLSource() { text.text = getXMLSource(data.firstChild, ''); } static function getXMLSource(pNode, sTabs) { var s = ''; if (sTabs != undefined) s = sTabs; s += '<' + pNode.nodeName; for (var prop in pNode.attributes) s += ' ' + prop + '="' + pNode.attributes[prop] + '"'; if (pNode.hasChildNodes()) { s += '>\n'; var iNode = pNode.firstChild; while (iNode) { s += getXMLSource(iNode, sTabs+'\t'); iNode = iNode.nextSibling; } s += sTabs + '\n'; } else { s += ' />\n'; } return s; } }