# XML ChildNodes Stuff

**URL:** <https://forum.kirupa.com/t/xml-childnodes-stuff/86842>\
**Category:** flash\
**Created:** [April 15, 2005, 10:04pm UTC](https://forum.kirupa.com/t/xml-childnodes-stuff/86842 "2005-04-15T22:04:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlashman](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@Phlashman](https://forum.kirupa.com/u/Phlashman)\
**Post date:** [April 15, 2005, 10:04pm UTC](https://forum.kirupa.com/t/xml-childnodes-stuff/86842/1 "2005-04-15T22:04:17Z")

</div>

Hi! I’m using XML, once again, and I’m getting pretty annoyed. I have an XML file similar to this:

```auto
<channel>
<item>
  <name>Item 1</name>
  <type>item</type>
  <purpose>no</purpose>
  </item>
<item>
   <name>Item 2</name>
   <type>item</type>
   <purpose>yes</purpose>
   </item>
</channel>

```

What would I do if I wanted to make an array of the names of each Item? This gets an array of each item:  
xml.results.firstChild.firstChild.childNodes  
But adding a .firstChild after that makes it undefined.

What should I do?
