docs: public void exportData(CmsExportParameters parameters) throws CmsImportExportException {
  
          m_parameters = parameters;
          m_exportCount = 0;
  
          // clear all caches
          getReport().println(Messages.get().container(Messages.RPT_CLEARCACHE_0), I_CmsReport.FORMAT_NOTE);
          OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_CLEAR_CACHES, new HashMap<String, Object>(0)));
  
          try {
              Element exportNode = openExportFile(parameters.getExportMode());
  
              if (m_parameters.getModuleInfo() != null) {
                  // add the module element
                  exportNode.add(m_parameters.getModuleInfo());
                  // write the XML
                  digestElement(exportNode, m_parameters.getModuleInfo());
              }
  
              // export account data only if selected
              if (m_parameters.isExportAccountData()) {
                  Element accountsElement = exportNode.addElement(CmsImportVersion10.N_ACCOUNTS);
                  getSaxWriter().writeOpen(accountsElement);
  
                  exportOrgUnits(accountsElement);
  
                  getSaxWriter().writeClose(accountsElement);
                  exportNode.remove(accountsElement);
              }
  
              // export resource data only if selected
              if (m_parameters.isExportResourceData()) {
                  exportAllResources(exportNode, m_parameters.getResources());
              }
  
              // export project data only if selected
              if (m_parameters.isExportProjectData()) {
                  Element projectsElement = exportNode.addElement(CmsImportVersion10.N_PROJECTS);
                  getSaxWriter().writeOpen(projectsElement);
  
                  exportProjects(projectsElement);
  
                  getSaxWriter().writeClose(projectsElement);
                  exportNode.remove(projectsElement);
              }
  
              closeExportFile(exportNode);
          } catch (SAXException se) {
              getReport().println(se);
  
              CmsMessageContainer message = Messages.get().container(
                  Messages.ERR_IMPORTEXPORT_ERROR_EXPORTING_TO_FILE_1,
                  getExportFileName());
              if (LOG.isDebugEnabled()) {
                  LOG.debug(message.key(), se);
              }
  
              throw new CmsImportExportException(message, se);
          } catch (IOException ioe) {
              getReport().println(ioe);
  
              CmsMessageContainer message = Messages.get().container(
                  Messages.ERR_IMPORTEXPORT_ERROR_EXPORTING_TO_FILE_1,
                  getExportFileName());
              if (LOG.isDebugEnabled()) {
                  LOG.debug(message.key(), ioe);
              }
  
              throw new CmsImportExportException(message, ioe);
          }
      }