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].@newID=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].@id)//traces the values correctly
   extraXML.item[n].@id=String(n);
// or: extraXML.item[n].@id=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.