DaftIE/src/main/java/org/openestate/io/daft_ie/DaftIeDocument.java
public static DaftIeDocument newDocument(Daft daft) throws ParserConfigurationException, JAXBException {
        if (StringUtils.isBlank(daft.getVersion()))
            daft.setVersion(DaftIeUtils.VERSION.toReadableVersion());

        Document document = XmlUtils.newDocument();
        DaftIeUtils.createMarshaller("UTF-8", true).marshal(daft, document);
        return new DaftIeDocument(document);
    }
public static DaftIeDocument newDocument(Daft daft) throws ParserConfigurationException, JAXBException {
        if (StringUtils.isBlank(daft.getVersion()))
            daft.setVersion(DaftIeUtils.VERSION.toReadableVersion());

        Document document = XmlUtils.newDocument();
        DaftIeUtils.createMarshaller("UTF-8", true).marshal(daft, document);
        return new DaftIeDocument(document);
    }
Creates a {@link DaftIeDocument} from a {@link Daft} object.

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