icapInfo_xml = new XML(); icapInfo_xml.ignoreWhite = true; icapInfo_xml.load('data.xml'); icapInfo_xml.onLoad = function (success) { if (success) { trace('data.xml loaded. Contents are: '+this.toString()); } }; // create a new XML document var doc:XML = new XML(); // create a root node var rootNode:XMLNode = doc.createElement("stats"); // create three child nodes var numbers:XMLNode = doc.createElement("numbers"); // add the rootNode as the root of the XML document tree doc.appendChild(rootNode); // add each of the child nodes as children of rootNode rootNode.appendChild(numbers); // create an array and use rootNode to populate it var firstArray:Array = doc.childNodes; trace (firstArray); // output: // create another array and use the child nodes to populate it var secondArray:Array = rootNode.childNodes; trace(secondArray); // output: txt = 'data.xml loaded. Contents are: '+this.childNodes[0].nodeValue;