Node name referencing

Hello all

I’m just starting to play with XML in Flash. I’ve managed to load in an xml file into an xml object and assign values from the XML to variables (displayed in dynamic text boxes at the moment).

I’m fairly new to this, and at the moment I’ve been referencing the attributes using firstChild.

MyVar = LoadedXML.firstChild.firstChild.firstChild.firstChild.nodeValue;

However this could get very messy once the XML becomes more complex. Is there a way of referencing the tags in the XML? Something similar to:

MyVar = LoadedXML.tagName1.nextTag.joeBloggs.whatever.nodeValue;