Adding the values of attributes?

I have an XML document with the following layout:

<?xml version="1.0" encoding="ISO-8859-1"?>
<allsales>
    <sales name='nameone' amount='377352' color='0xCC0033' rookie='0'/>
    <sales name='nametwo' amount='205521' color='0x663366' rookie='0'/>
    <sales name='namethree' amount='205521' color='0x0033FF' rookie='0'/>
    <sales name='namefour' amount='5521' color='0x663366' rookie='0'/>
    <sales name='namefive' amount='20' color='0x663366' rookie='0'/>
</allsales>

If you’ll notice, I have an attribute, “color”, which actually represents one of 5 bars that will appear on a graph. I also have an attribute “amount”, that needs to get added together. (all “amounts” from within each category)So what I’d like to do is pull this xml doc into flash, (Which I’ve already done. I can’t modify the doc to better suit my purpose though since the data is being used elsewhere), create maybe an array(?) for each of the 5 ‘colors’ attributes (3 shown here), and the values of ‘amount’ for each of the matching ‘colors’, then have a final tally output so I can have variables that will say, for example: color CC0033 = “Territory1” = 567567 total amount, color 663366 = “Territory 2” = 345987 total amount, etc…

Wow huh? Looks like I need to make several arrays and compare them or something? I’m pretty proficient in the basics of flash as, but arrays are unfortunately at this point beyond me. If I’m barking up the wrong tree and should do this a different way, please feel free to let me know.

Thanks,
-D