public void setDocumentFactory(DocumentFactory factory) {
        this.factory = factory;
    }
<p>This sets the <code>DocumentFactory</code> used to create new documents.
This method allows the building of custom DOM4J tree objects to be implemented
easily using a custom derivation of {@link DocumentFactory}</p>

@param factory <code>DocumentFactory</code> used to create DOM4J objects
xmppserver/src/main/java/org/dom4j/io/XMPPPacketReader.java