@Override
    public void endDocument() throws SAXException {
        super.endDocument();

        if ( autoFlush ) {
            try {
                flush();
            } catch (IOException e) {
                Log.trace("An exception occurred while trying to flush during ending of a document", e);
            }
        }
    }
<p>Writes the closing tag of an {@link Element}</p>

@param element <code>Element</code> to output.
@throws IOException if the element could not be written
xmppserver/src/main/java/org/jivesoftware/util/XMLWriter.java