docs: public static CmsXmlPage unmarshal(CmsObject cms, CmsFile file, boolean keepEncoding) throws CmsXmlException {
  
          byte[] content = file.getContents();
  
          String fileName = cms.getSitePath(file);
          boolean allowRelative = false;
          try {
              allowRelative = Boolean.valueOf(
                  cms.readPropertyObject(fileName, CmsXmlPage.PROPERTY_ALLOW_RELATIVE, false).getValue()).booleanValue();
          } catch (CmsException e) {
              // allowRelative will be false
          }
  
          String encoding = null;
          try {
              encoding = cms.readPropertyObject(
                  fileName,
                  CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING,
                  true).getValue();
          } catch (CmsException e) {
              // encoding will be null
          }
          if (encoding == null) {
              encoding = OpenCms.getSystemInfo().getDefaultEncoding();
          } else {
              encoding = CmsEncoder.lookupEncoding(encoding, null);
              if (encoding == null) {
                  throw new CmsXmlException(Messages.get().container(Messages.ERR_XML_PAGE_FACT_INVALID_ENC_1, fileName));
              }
          }
  
          CmsXmlPage newPage;
          if (content.length > 0) {
              // content is initialized
              if (keepEncoding) {
                  // use the encoding from the content
                  newPage = unmarshal(content, encoding, new CmsXmlEntityResolver(cms));
              } else {
                  // use the encoding from the file property
                  // this usually only triggered by a save operation
                  try {
                      String contentStr = new String(content, encoding);
                      newPage = unmarshal(contentStr, encoding, new CmsXmlEntityResolver(cms));
                  } catch (UnsupportedEncodingException e) {
                      // this will not happen since the encodig has already been validated
                      throw new CmsXmlException(
                          Messages.get().container(Messages.ERR_XML_PAGE_FACT_INVALID_ENC_1, fileName),
                          e);
                  }
              }
          } else {
              // content is empty
              newPage = new CmsXmlPage(cms.getRequestContext().getLocale(), encoding);
          }
  
          newPage.setFile(file);
          newPage.setAllowRelativeLinks(allowRelative);
  
          return newPage;
      }