docs: private CmsXmlContent writeContent(CmsObject cms, CmsFile file, CmsXmlContent content, String encoding)
      throws CmsException {
  
          String decodedContent = content.toString();
          try {
              file.setContents(decodedContent.getBytes(encoding));
          } catch (UnsupportedEncodingException e) {
              throw new CmsException(
                  org.opencms.workplace.editors.Messages.get().container(
                      org.opencms.workplace.editors.Messages.ERR_INVALID_CONTENT_ENC_1,
                      file.getRootPath()),
                  e);
          }
          // the file content might have been modified during the write operation
          cms.getRequestContext().setAttribute(ATTR_EDITOR_SAVING, "true");
          try {
              file = cms.writeFile(file);
          } finally {
              cms.getRequestContext().removeAttribute(ATTR_EDITOR_SAVING);
          }
          return CmsXmlContentFactory.unmarshal(cms, file);
      }