Working on this bug, where addItemAt / addItem on the XMLListCollection was not parenting all the children properly. In particular, it was updating the XML Parents of items that were not modified (rather, were simply bumped to a later position on the list).
I have a branch of develop that fixes this, however, I want to pose a question to the list : - Do we NOT reparent the item added to the list? If this is the option, then the user will have to do this by hand. This is probably the safest route, but the parent will be null. - If we DO parent the item added to the list - Do we always parent it to the root node of the XMLList that it was added to (this is an assumption), or do we try and guess based on other elements in the list? - If we DO parent it to another item, then it will change the parent of any other items this item was copied from. XML items are copied by reference (not by value), unless copy used the .copy() function on the XML object. This means that if I do the following code : myXMLItem = myXMLList[3]; myNewXMLCol.addItem(myXMLItem); that the parent of the myXMLItem will be set to the root (or other node) of myNewXMLCol. This also means that index 3 of myXMLList will have it's parent updated to that same parent... Just wanted to see how I should go with this. By fixing the bug (which is a bug), I stand to break code either way that I go -- depending on expectations. -Nick