My guess would be that you have closed the outermost element, so you are not allowed to open a new one because XML only allows one element at the outermost level.
This kind of interface is very handy for writing XML and I use it myself, but it can be a pig to debug if you make any nesting mistakes. I've been known to use my own wrapper for the interface in which the calls to endElement have to specify the matching tag name; the wrapper can then check the correct nesting of the calls, which helps greatly to identify where the error is.