ImmoXML/src/main/java/org/openestate/io/immoxml/ImmoXmlDocument.java
public static ImmoXmlDocument newDocument(Immoxml immoxml) throws ParserConfigurationException, JAXBException {
        if (immoxml.getUebertragung() == null)
            immoxml.setUebertragung(ImmoXmlUtils.getFactory().createUebertragung());
        if (StringUtils.isBlank(immoxml.getUebertragung().getVersion()))
            immoxml.getUebertragung().setVersion(ImmoXmlUtils.VERSION.toReadableVersion());

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

        Document document = XmlUtils.newDocument();
        ImmoXmlUtils.createMarshaller("UTF-8", true).marshal(immoxml, document);
        return new ImmoXmlDocument(document);
    }
public static ImmoXmlDocument newDocument ( Immoxml immoxml ) throws ParserConfigurationException , JAXBException { if ( immoxml . getUebertragung ( ) == null ) immoxml . setUebertragung ( ImmoXmlUtils . getFactory ( ) . createUebertragung ( ) ) ; if ( StringUtils . isBlank ( immoxml . getUebertragung ( ) . getVersion ( ) ) ) immoxml . getUebertragung ( ) . setVersion ( ImmoXmlUtils . VERSION . toReadableVersion ( ) ) ; Document document = XmlUtils . newDocument ( ) ; ImmoXmlUtils . createMarshaller ( "UTF-8" , true ) . marshal ( immoxml , document ) ; return new ImmoXmlDocument ( document ) ; }
Creates a {@link ImmoXmlDocument} from a {@link Immoxml} object.

@param immoxml Java object, that represents the &lt;immoxml&gt; root element
@return created document
@throws ParserConfigurationException if the parser is not properly configured
@throws JAXBException                if a problem with JAXB occurred
Creates a { @link ImmoXmlDocument } from a { @link Immoxml } object .