How well does this method of XML generation scale? If not well, are there other methods for dealing with large XML documents?
Also, are there methods to "backtrack" and modify the XML document while building it? For example, say that I have an event-driven model. I get event X, which causes me to add the element "element" to the structure. Then, some point in the future, I get an event Y which indicates I have to go back to that "element" and modify it in some way.
It actually scales very well, as long as you're using a proper output stream and nor cStringIO or something like that. It emits as it goes and holds very little state.
As for back-tracking, that sounds very contradictory to your ned for scalablity: backtracking requires maintaining stte, which makes it non-scalable. But to answer your question anyway, backtracking is not very easy using this techique.