Parsing XML

Hey guys, got a question for you.

I have an XML document that looks like this:


<?xml version="1.0" encoding="iso-8859-1"?>
<buildYourOwnItems>
    <!-- BASE -->
    <item name="base">
        <name>base</name>
        <thumb>gfx/thumbs/base.png</thumb>
        <image>gfx/base.png</image>
        <price>$7000</price>
    </item>
    <!-- STEEL TABLES -->
    <item name="table1">
        <name>table1</name>
        <thumb>gfx/thumbs/table1.png</thumb>
        <image>gfx/table1.png</image>
        <price>$7000</price>
    </item>
</buildYourOwnItems>

I want to parse this in Actionscript3. I can return the attributes (name=“base”), but cannot receive the values of just the nodes. When I use this code:


loader.load(req);

loader.addEventListener("complete", init);

function init(e:Event){
  doc.ignoreWhite = true;
  xml = XML(loader.data);
  doc.parseXML(xml.toXMLString());
  for(var i = 0; i<doc.firstChild.childNodes.length; i++){
    //trace(doc.firstChild.childNodes*.attributes.name);
    trace(doc.firstChild.childNodes*.firstChild);    
  }
}

(The commented line would return the attribute)

I get the full tag. How can I isolate just the node value??

Thanks!

-theonlycarmire