Add a simple XML generator that keeps its state on the stack.
It uses object destruction to close elements and attributes.