XML Slideshow

Hi - I am currently using the great Kirupa xml slideshow tutorial, but am having issues as I have separated the slideshow images into different categories - ie. the xml will contain a number of client nodes, each with with a separate list of project nodes.

XML:

<client>
    <name>Client name</name>
    <project>
        <image>images/xxx.gif</image>
        <description>Decription for project 1 appears here</description>
    </project>
    <project>
         <image>images/xxx.gif</image>
         <description>Decription for project 2 appears here</description>
     </project>
     <project>
          <image>images/xxx.gif</image>
          <description>Decription for project 3 appears here</description>
     </project>
</client>

I’ve just been trying to use 2 separate ‘for loops’, one counting client nodes and one counting project nodes. It seems to be pulling the data ok when I traced it, but I’m stuck on how to include both counts into the 3 arrays.

AS:

xmlNode = this.firstChild;
clientname = [];
imagedescription = [];
imagepath = [];

total = xmlNode.childNodes.length;
subtotal = xmlNode.firstChild.childNodes.length;

for (n=0; n<total; n++) {
for (i=0; i<subtotal; i++) {
clientname[ni] = xmlNode.childNodes[n].childNodes[0].firstChild.nodeValue;
imagepath[ni] = xmlNode.childNodes[n].childNodes*.childNodes[0].firstChild.nodeValue;
imagedescription[ni] = xmlNode.childNodes[n].childNodes*.childNodes[1].firstChild.nodeValue;
}
}

As you can see I have tried using [ni] to no avail. Any ideas on how I could achieve this?

Thanks