document.setPath(path);
AbstractBaseElement documentImpl = (AbstractBaseElement)document;
documentImpl.setHandlerFactory(handlerFactory);
documentImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
documentImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
boolean dirty = documentImpl.unmarshalled(generator);
if (dirty || document.isDirty()){
updateDocument(document, true);
document.setDirty(false);
}
}