Examples/src/main/java/org/openestate/io/examples/OpenImmoReadingExample.java
@SuppressWarnings("Duplicates")
    protected static void printToConsole(OpenImmoTransferDocument doc) throws JAXBException {
        LOGGER.info("> process transfer document in version "
                + doc.getDocumentVersion());

        Openimmo openimmo = doc.toObject();

        // process agencies in the document
        for (Anbieter anbieter : openimmo.getAnbieter()) {
            LOGGER.info(">> found agency '" + anbieter.getAnbieternr() + "'");

            // process real estates of the agency
            for (Immobilie immobilie : anbieter.getImmobilie()) {
                // get object nr
                String objectNr = (immobilie.getVerwaltungTechn() != null) ?
                        immobilie.getVerwaltungTechn().getObjektnrIntern() : "???";

                // get object title
                String objectTitle = (immobilie.getFreitexte() != null) ?
                        immobilie.getFreitexte().getObjekttitel() : "???";

                // print object information to console
                LOGGER.info(">>> found object '" + objectNr + "' "
                        + "with title '" + objectTitle + "'");
            }
        }
    }
@SuppressWarnings("Duplicates")
    protected static void printToConsole(OpenImmoTransferDocument doc) throws JAXBException {
        LOGGER.info("> process transfer document in version "
                + doc.getDocumentVersion());

        Openimmo openimmo = doc.toObject();

        // process agencies in the document
        for (Anbieter anbieter : openimmo.getAnbieter()) {
            LOGGER.info(">> found agency '" + anbieter.getAnbieternr() + "'");

            // process real estates of the agency
            for (Immobilie immobilie : anbieter.getImmobilie()) {
                // get object nr
                String objectNr = (immobilie.getVerwaltungTechn() != null) ?
                        immobilie.getVerwaltungTechn().getObjektnrIntern() : "???";

                // get object title
                String objectTitle = (immobilie.getFreitexte() != null) ?
                        immobilie.getFreitexte().getObjekttitel() : "???";

                // print object information to console
                LOGGER.info(">>> found object '" + objectNr + "' "
                        + "with title '" + objectTitle + "'");
            }
        }
    }
Print some content of an {@link OpenImmoTransferDocument} to console.

@param doc the document to process
@throws JAXBException if XML conversion into Java objects failed