public void endDocument() throws SAXException {
// The stack should be empty if the document was well-formed
// Note I think a SAX2 parser will find this by default anyway,
// certainly Xerces seems to...
if (!currentNodes.empty()) {
throw new ExtendedSAXException("handler stack not empty");
}
}