code: public void writeConfiguration(Class<?> clazz) throws IOException, CmsConfigurationException {
  
          I_CmsXmlConfiguration configuration = getConfiguration(clazz);
          if (configuration == null) {
              throw new CmsConfigurationException(
                  Messages.get().container(Messages.ERR_CONFIG_WITH_UNKNOWN_CLASS_1, clazz.getName()));
          }
  
          // generate the file URL for the XML input
          File file = new File(m_baseFolder, configuration.getXmlFileName());
          if (LOG.isDebugEnabled()) {
              LOG.debug(Messages.get().getBundle().key(Messages.LOG_WRITE_CONFIG_XMLFILE_1, file.getAbsolutePath()));
          }
  
          // generate the XML document
          Document config = generateXml(configuration);
  
          // output the document
          XMLWriter writer = null;
          OutputFormat format = OutputFormat.createPrettyPrint();
          format.setIndentSize(4);
          format.setTrimText(false);
          format.setEncoding(CmsEncoder.ENCODING_UTF_8);
  
          OutputStream out = null;
          try {
              out = new FileOutputStream(file);
              writer = new XMLWriter(out, format);
              writer.write(config);
              writer.flush();
          } finally {
              if (writer != null) {
                  writer.close();
              }
              if (out != null) {
                  out.close();
              }
          }
  
          if (configuration instanceof I_CmsXmlConfigurationWithUpdateHandler) {
              try {
                  LOG.info("Running configuration update handler for " + configuration.getClass().getName());
                  ((I_CmsXmlConfigurationWithUpdateHandler)configuration).handleUpdate();
                  LOG.info("Finished configuration update handler for " + configuration.getClass().getName());
              } catch (Exception e) {
                  LOG.error(e.getLocalizedMessage(), e);
              }
          }
  
          if (LOG.isInfoEnabled()) {
              LOG.info(
                  Messages.get().getBundle().key(
                      Messages.LOG_WRITE_CONFIG_SUCCESS_2,
                      file.getAbsolutePath(),
                      configuration.getClass().getName()));
          }
  
      }
docs: Writes the XML configuration for the provided configuration instance.<p>
  
  @param clazz the configuration class to write the XML for
  @throws IOException in case of I/O errors while writing
  @throws CmsConfigurationException if the given class is not a valid configuration class