code: private void writePageAndReport(CmsXmlPage page, boolean report) throws CmsException {
  
          CmsFile file = page.getFile();
          byte[] content = page.marshal();
          file.setContents(content);
          // check lock
          CmsLock lock = getCms().getLock(file);
          if (lock.isNullLock() || lock.isOwnedBy(getCms().getRequestContext().getCurrentUser())) {
              // lock the page
              checkLock(getCms().getSitePath(file));
              // write the file with the new content
              getCms().writeFile(file);
              // unlock the page
              getCms().unlockResource(getCms().getSitePath(file));
              if (report) {
                  m_report.println(
                      Messages.get().container(Messages.RPT_ELEM_RENAME_2, getParamOldElement(), getParamNewElement()),
                      I_CmsReport.FORMAT_OK);
              }
          }
      }
docs: Writes the given xml page by reporting the result.<p>
  
  @param page the xml page
  @param report if true then some output will be written to the report
  @throws CmsException if operation failed