OpenImmo/src/main/java/org/openestate/io/openimmo/OpenImmoTransferDocument.java
public static OpenImmoTransferDocument newDocument(Openimmo openimmo) throws ParserConfigurationException, JAXBException {
        if (openimmo.getUebertragung() == null)
            openimmo.setUebertragung(OpenImmoUtils.getFactory().createUebertragung());
        if (StringUtils.isBlank(openimmo.getUebertragung().getVersion()))
            openimmo.getUebertragung().setVersion(OpenImmoUtils.VERSION.toReadableVersion());

        Document document = XmlUtils.newDocument();
        OpenImmoUtils.createMarshaller("UTF-8", true).marshal(openimmo, document);
        return new OpenImmoTransferDocument(document);
    }
public static OpenImmoTransferDocument newDocument(Openimmo openimmo) throws ParserConfigurationException, JAXBException {
        if (openimmo.getUebertragung() == null)
            openimmo.setUebertragung(OpenImmoUtils.getFactory().createUebertragung());
        if (StringUtils.isBlank(openimmo.getUebertragung().getVersion()))
            openimmo.getUebertragung().setVersion(OpenImmoUtils.VERSION.toReadableVersion());

        Document document = XmlUtils.newDocument();
        OpenImmoUtils.createMarshaller("UTF-8", true).marshal(openimmo, document);
        return new OpenImmoTransferDocument(document);
    }
Creates a {@link OpenImmoTransferDocument} from a {@link Openimmo} object.

@param openimmo Java object, that represents the &lt;openimmo&gt; root element
@return created document
@throws ParserConfigurationException if the parser is not properly configured
@throws JAXBException                if a problem with JAXB occurred