The following example creates a new XML packet and uses the
iterate through the child nodes of the root node:
// create a new XML document
var doc:XML = new XML("<rootNode><oldest /><middle /><youngest /></
rootNode>");
var rootNode:XMLNode = doc.firstChild;
// use lastChild to iterate through the child nodes of rootNode
for (var aNode:XMLNode = rootNode.lastChild; aNode != null;
aNode=aNode.previousSibling) {
trace(aNode);
}
/*
output:
<youngest />
<middle />
<oldest />
*/
See also
XML.appendChild(), XML.insertBefore(), XML.removeNode(),
property to
XML.lastChild
XMLNode class
XML.lastChild 1033