code: private void setXmlContentFromFile(
          CmsResource cmsResource,
          CmsFile cmsFile,
          CmsObject cmsObject,
          String xmlContent,
          String encodingType,
          I_CmsReport report) {
  
          try {
              byte[] fileContent = xmlContent.getBytes(encodingType);
              cmsFile.setContents(fileContent);
              // write into file
              cmsObject.writeFile(cmsFile);
              // unlock resource
              try {
                  cmsObject.unlockResource(cmsObject.getSitePath(cmsResource));
              } catch (CmsException e) {
                  m_errorTransform += 1;
                  report.println(
                      Messages.get().container(Messages.RPT_CONVERTXML_UNLOCK_FILE_1, cmsObject.getSitePath(cmsResource)),
                      I_CmsReport.FORMAT_ERROR);
                  if (LOG.isErrorEnabled()) {
                      LOG.error(e.getMessageContainer(), e);
                  }
              }
          } catch (Exception e) {
              m_errorTransform += 1;
              String reportContent = "<br/>";
              reportContent = reportContent + CmsEncoder.escapeXml(xmlContent);
              reportContent = reportContent.replaceAll("\r\n", "<br/>");
              report.println(
                  Messages.get().container(Messages.RPT_CONVERTXML_WRITE_ERROR_1, reportContent),
                  I_CmsReport.FORMAT_ERROR);
              if (LOG.isErrorEnabled()) {
                  LOG.error(e.toString());
              }
          }
      }
docs: Gets file xml content.<p>
  
  @param cmsResource current resource CmsResource
  @param cmsFile current CmsFile
  @param cmsObject current CmsObject
  @param xmlContent xml content to write
  @param encodingType encoding type
  @param report I_CmsReport