Trying to get a grip on XML

Hmm, trying get a grip on loading from XML. Want to attach my mc’s using XML and thinking it should be done something like this. Of course not working but hoping someone could point out whats wrong and I’ll go from there.

My AS:

var space:Number = 20;
var navArray = new Array();

var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
    if (success) {
		trace("success: "+this.status);
        var xmlData = this.firstChild;
		for (var i:Number = 0; i<xmlData.childNodes.length; i++) {
		var position:Number = ((i)*space);
		attachMovie("mainNav", "mainNav"+i+"_mc", this.getNextHighestDepth(), {_x:100, _y:position});
		var main = this["mainNav"+i+"_mc"];
		main.t.text = navArray;
    } else {
        main.t.text = "Not loaded";


		<menu>text 1</menu>
		<menu>text 2</menu>
		<menu>text 3</menu>
		<menu>text 4</menu>