StaxMate Outputters

StaxMate output side is built using concept of nested synchronized output objects. These can be thought of as nested contexts, in a way similar to nested iterators. However, unlike iterators, there are no "flat" output contexts.

Output contexts provide 3 main improvements over raw StAX API:

1. Output objects can be safely passed to other processing components, without having to worry about "does callee close all open elements": element balancing (nesting) is handled hierarchically by the output objects based on output done using them. This is very similar to the way iterators co-ordinate things on input side.
2. Namespace handling is absolutely correct, as with StAX "repairing" mode, but with very little overhead. This is achieved by using "local singleton" Namespace objects (ones for which equality checking using "==" works within context of a single output document)
3. It is possible to do some out-of-document-order output (output children, then add attributes to the parent, without adding full in-memory DOM tree overhead; memory overhead is directly proportional to amount of buffered output needed, which is generally only small portion of the whole output document.