public void write(Entity entity) throws IOException {
        writeEntity( entity );

        if ( autoFlush ) {
            flush();
        }
    }
Writes the given {@link Entity}.

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