Changing attribute values E4X

Hi,
I am loading an xml file into flash and trying to change the attribute values within flash.
I can change one value like this:

extraXML.item[3][email protected]=String(300);

This changes the attribute value of the ‘id’ attribute in the fourth node just fine into ‘300’.
But when I try to do this for all the nodes, like:

for(var n:uint=0; n <extraXML.item.length(); n++){
    trace(extraXML.item[n][email protected])//traces the values correctly
   extraXML.item[n][email protected]=String(n);
// or: extraXML.item[n][email protected]=n;
   }

the values are being changed but come out messily organized, randomly as it seems. The idea is that I would like to number the id’s from 0 to extraXML.item.length().

Must be missing something!

Thanks,
Jerryj.