Probably a simple xml problem

I’m goin’ crazy! I’m confused about the difference between an element node and a text node. I’m loading xml nodes from a php page. Here is a piece of the xml:

<tierOneArray>
<item id=“207” galleryID=“3” moduleID=“0”>
<photoFile>photo_gallery207.jpg</photoFile>
<caption>pic 02</caption>
<credit>unknown</credit>
<creditURL>unknown</creditURL>
<uploadDate>2007-09-28 05:38:39</uploadDate>
<module>gallery</module>
</item>
(followed by many items, and terminating with </tierOneArray>

When I ask for the firstChild.firstChild.firstChild I literally get “<photoFile>photo_gallery207.jpg</photoFile>”.

When I ask for firstChild.firstChild.firstChild.nodeValue, I get “null”.

When I ask for the nodeType, I get “1”.

So I have several questions:

How does flash know that it’s not a text node? If I were using Flash to write the xml, I could use “createTextNode”, but it’s being written by another website.
I need the “photo_gallery207.jpg” without the tags. They are mostly urls. How do I do this?

I just don’t get it.