Core/src/main/java/org/openestate/io/core/XmlConvertableDocument.java
public void downgrade(VersionType targetVersion) {
        if (targetVersion == null)
            throw new NullPointerException("No target version was provided!");

        XmlVersion currentVersion = this.getDocumentVersion();
        if (currentVersion == null) {
            currentVersion = this.getLatestVersion();
            LOGGER.warn("Can't determine document version! Assuming latest version "
                    + currentVersion.toReadableVersion() + ".");
        }
        if (currentVersion == targetVersion) return;

        if (currentVersion.isOlderThen(targetVersion)) {
            LOGGER.warn("The provided target version (" + targetVersion.toReadableVersion() + ") "
                    + "is newer then the document version (" + currentVersion.toReadableVersion() + ").");
            return;
        }

        XmlVersion v = currentVersion;
        while (true) {
            v.getConverter().downgradeToPreviousVersion(this);
            v = v.getPreviousVersion();
            if (v == targetVersion) break;
        }
    }
public void downgrade(VersionType targetVersion) {
        if (targetVersion == null)
            throw new NullPointerException("No target version was provided!");

        XmlVersion currentVersion = this.getDocumentVersion();
        if (currentVersion == null) {
            currentVersion = this.getLatestVersion();
            LOGGER.warn("Can't determine document version! Assuming latest version "
                    + currentVersion.toReadableVersion() + ".");
        }
        if (currentVersion == targetVersion) return;

        if (currentVersion.isOlderThen(targetVersion)) {
            LOGGER.warn("The provided target version (" + targetVersion.toReadableVersion() + ") "
                    + "is newer then the document version (" + currentVersion.toReadableVersion() + ").");
            return;
        }

        XmlVersion v = currentVersion;
        while (true) {
            v.getConverter().downgradeToPreviousVersion(this);
            v = v.getPreviousVersion();
            if (v == targetVersion) break;
        }
    }
Downgrades the contained {@link Document} to an earlier version.

@param targetVersion the version, that the {@link Document} is downgraded to