Parsing XML File in flash

<categories>
<category type=“food”>
<word>Tea</word1>
</category>
<category type=“furniture”>
<word>Chair</word1>
</category>
</categories>

I’m wondering how can I read & display the attribute value of category?
Like I want to read food & furniture in a loop

xmlfile.firstChild.childNodes*.childNodes[j].firstChild.nodeValue
thats for reading node values but what for attributes?