Core/src/main/java/org/openestate/io/core/XmlConvertableDocument.java
public void upgrade(XmlVersion 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.isNewerThen(targetVersion)) {
            LOGGER.warn("The provided target version (" + targetVersion.toReadableVersion() + ") "
                    + "is older then the document version (" + currentVersion.toReadableVersion() + ").");
            return;
        }

        XmlVersion v = currentVersion;
        while (true) {
            v = v.getNextVersion();
            v.getConverter().upgradeFromPreviousVersion(this);
            if (v == targetVersion) break;
        }
    }
public void upgrade(XmlVersion 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.isNewerThen(targetVersion)) {
            LOGGER.warn("The provided target version (" + targetVersion.toReadableVersion() + ") "
                    + "is older then the document version (" + currentVersion.toReadableVersion() + ").");
            return;
        }

        XmlVersion v = currentVersion;
        while (true) {
            v = v.getNextVersion();
            v.getConverter().upgradeFromPreviousVersion(this);
            if (v == targetVersion) break;
        }
    }
Upgrades the contained {@link Document} to a newer version.

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