The first Childnodes can not be found but not the rest;(

Hello,
The following line of code gives the correct path for the picture to be loaded:

[AS]
_root.picture.loadMovie(pictures.childNodes[x].childNodes[y].attributes[“jpegURL”]);
[/AS]
The following XML is an example of how I have structured it. So polaroid is one group and wideportraits another. So if I want to get at a picture in ‘polaroid’, then x = 0 (see AS above) and if I want to get to ‘widepotraits’, then x = 1 and so on. I have about 14 of these groups. Then to choose the picture I want, then y = 0 or 1 etc.

Howver, while this works for the first 4 groups of the XML, once x = 4 (group 5) it does not load the image.

Surely there is no limit to the number of childnodes?
What else shoould I check in my XML to make sure it works - all the image pathways are correct.
[AS]
polaroid>
<picture jpegURL=“photos/advertising/polaroid07.jpg”>Polaroid 1</picture>
<picture jpegURL=“photos/advertising/polaroid02.jpg”>Polaroid 2</picture>
<picture jpegURL=“photos/advertising/polaroid06.jpg”>Polaroid 3</picture>
<picture jpegURL=“photos/advertising/polaroid01.jpg”>Polaroid 4</picture>
<picture jpegURL=“photos/advertising/polaroid05.jpg”>Polaroid 5</picture>
<picture jpegURL=“photos/advertising/polaroid08.jpg”>Polaroid 6</picture>
<picture jpegURL=“photos/advertising/polaroid03.jpg”>Polaroid 7</picture>
<picture jpegURL=“photos/advertising/polaroid09.jpg”>Polaroid 8</picture>
<picture jpegURL=“photos/advertising/polaroid04.jpg”>Polaroid 9</picture>
</polaroid>
<wideportraits>
<picture jpegURL=“photos/portraits/wideportraits/actors.jpg”>Actors</picture>
<picture jpegURL=“photos/portraits/wideportraits/artist.jpg”>Artists</picture>
<picture jpegURL=“photos/portraits/wideportraits/it_people.jpg”>It people</picture>
<picture jpegURL=“photos/portraits/wideportraits/musicians.jpg”>musicians</picture>
<picture jpegURL=“photos/portraits/wideportraits/scientists.jpg”>Scientists</picture>
</wideportraits>
[/AS]