A few months back, I'd been threatening to make some significant changes to the XML code during this release cycle, and one of them just bit us. I was hoping it would go smoother than it apparently has.
The issue is this: a lot of cleanup and implementation-hiding in the XML code is blocked by the fact that many parts of the code currently create XML nodes which are not initially attached to any document.
This is compounded by the fact that a great deal of code doesn't know what the relevant document is, since it was long assumed that it could be set up with a document later.
So, a lot of code has to be rewritten to plumb the relevent XML document in. I added an assertion to trap any code that neglects to create nodes with a document, and am proceeding from there to rework the affected code. That was the reason for the recent "Save As" crash.
I wish there were a "nicer" way to do this, but after six years I've come to the conclusion that the drastic approach is the only way to get this done.
-mental