One more possible solution I had pondered: #3 We don't store the XML nodes in an XMLList internally. We store them in an array. When someone calls addItemAt() we add it to the correct index in the array, but to the end of the source XMLList. So the XMLList would always look like we appended the new node to the end (cause we did), but the collection would always should it in the right order.
This is a lighter-weight (maybe) variation on #1. At its core, these are the issues that are always going to mess with you so keep them in mind when thinking of other options: Now, _apologies_. I misread your patch and saw the original variation, hence my thinking you had caused problems with the parenting. Your solution is basically my #2, but the issue is going to be if someone is holding onto a reference to the source property. This is common with XMLList as you can't do e4x operations on the collection. Just ponder #1 or #3 for me and let's see what else we can do. Cheers, Mike