ARRAY Experts ,please help

Hello,

How can I code this so I can just use an array to have the function load info from an xml page, instead of having to tediously re-write each line and increment the number?
These are just 6 lines of data and I need to add 40 more.

Thanks in advance.

function loadXML(loaded) {
if (loaded) {
_root.menu1.linkname = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.menu1.link = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link2[/color]](javascript:golink(2))name = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link2[/color]](javascript:golink(2)) = this.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link3[/color]](javascript:golink(3))name = this.firstChild.childNodes[0].childNodes[4].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link3[/color]](javascript:golink(3)) = this.firstChild.childNodes[0].childNodes[5].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link4[/color]](javascript:golink(4))name = this.firstChild.childNodes[0].childNodes[6].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link4[/color]](javascript:golink(4)) = this.firstChild.childNodes[0].childNodes[7].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link5[/color]](javascript:golink(5))name = this.firstChild.childNodes[0].childNodes[8].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link5[/color]](javascript:golink(5)) = this.firstChild.childNodes[0].childNodes[9].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link6[/color]](javascript:golink(6))name = this.firstChild.childNodes[0].childNodes[10].firstChild.nodeValue;
_root.menu1.[[color=#0000ff]Link6[/color]](javascript:golink(6)) = this.firstChild.childNodes[0].childNodes[11].firstChild.nodeValue;
_root.menu1.link_txt.htmlText = “<a href=’”+ _root.menu1.link+ “’><b>”+ _root.menu1.linkname +"</b></a>";
_root.menu1.[[color=#0000ff]Link2[/color]_txt.htmlText = “<a href=’”+ _root.menu1.[url=“javascript:golink(2)”][color=#0000ff]Link2[/color]+ “’><b>”+ _root.menu1.[url=“javascript:golink(2)”][color=#0000ff]Link2[/color]](javascript:golink(2))name +"</b></a>";
_root.menu1.[[color=#0000ff]Link3[/color]_txt.htmlText = “<a href=’”+ _root.menu1.[url=“javascript:golink(3)”][color=#0000ff]Link3[/color]+ “’><b>”+ _root.menu1.[url=“javascript:golink(3)”][color=#0000ff]Link3[/color]](javascript:golink(3))name +"</b></a>";
_root.menu1.[[color=#0000ff]Link4[/color]_txt.htmlText = “<a href=’”+ _root.menu1.[url=“javascript:golink(4)”][color=#0000ff]Link4[/color]+ “’><b>”+ _root.menu1.[url=“javascript:golink(4)”][color=#0000ff]Link4[/color]](javascript:golink(4))name +"</b></a>";
_root.menu1.[[color=#0000ff]Link5[/color]_txt.htmlText = “<a href=’”+ _root.menu1.[url=“javascript:golink(5)”][color=#0000ff]Link5[/color]+ “’><b>”+ _root.menu1.[url=“javascript:golink(5)”][color=#0000ff]Link5[/color]](javascript:golink(5))name +"</b></a>";
_root.menu1.[[color=#0000ff]Link6[/color]_txt.htmlText = “<a href=’”+ _root.menu1.[url=“javascript:golink(6)”][color=#0000ff]Link6[/color]+ “’><b>”+ _root.menu1.[url=“javascript:golink(6)”][color=#0000ff]Link6[/color]](javascript:golink(6))name +"</b></a>";