@Override
    public void endDocument() throws SAXException {
        try {
            if (!omitRoot) {
                w.write("} finally {\ncontentHandler.endDocument();\n}\n");
            }
            w.write("}\n");
            w.write("private static final char[] __chars__ = ");
            w.write(charArrayLiteral(sb));
            w.write(";\n}\n");
            w.flush();
            w.close();
        } catch (IOException e) {
            throw new SAXException(e);
        }
    }
@see org.xml.sax.ContentHandler#endDocument()
src/nu/validator/xml/SaxCompiler.java