# AS3 Need help making XMLList of every childnode

**URL:** <https://forum.kirupa.com/t/as3-need-help-making-xmllist-of-every-childnode/288415>\
**Category:** flash\
**Created:** [May 15, 2009, 1:15pm UTC](https://forum.kirupa.com/t/as3-need-help-making-xmllist-of-every-childnode/288415 "2009-05-15T13:15:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessicaD](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@jessicaD](https://forum.kirupa.com/u/jessicaD)\
**Post date:** [May 15, 2009, 1:15pm UTC](https://forum.kirupa.com/t/as3-need-help-making-xmllist-of-every-childnode/288415/1 "2009-05-15T13:15:08Z")

</div>

Hi people,

I have a question about getting data out of a XML. I have made the following XML [http://pastebin.com/m5057f168](http://pastebin.com/m5057f168) and as you can see I have a structure like this:

\<gallery\>  
\<subgallery\>  
\<image\>\</image\>  
\</subgallery\>  
\<image\>\</image\>  
\</gallery\>

So a gallery can have single images (not in a subgallery) and it can be in a subgallery with several pictures. What I want to do is get an array or XMLList from every subgallery (sometimes I have up to 3 subgalleries) in a gallery node. But I have the following code:

```
        private function getSubGalleries() : void{
            var galleryXML:XML = bulkLoader.getXML(xmlPath+"images.php");
            var galleryList:XMLList = galleryXML.gallery;
            var subgalleryList:XMLList = new XMLList();
 
             for each (var object:XML in galleryList) {
                if(object.@title == "stills") {
                    if(object.hasOwnProperty("subgallery")) {
                        subgalleryList = object.subgallery.images;
                    }
                }
            }
        }

```

This only gives me ONE XMLList with all the images nodes in all the subgalleries. How can I split that. So that I have one XMLList from subgallery 1 and a second XMLList from subgallery 2?

I hope someone can help me!

Grtz Jessica
