docs: protected void exportAllResources(Element parent, List<String> resourcesToExport)
      throws CmsImportExportException, IOException, SAXException {
  
          // export all the resources
          String resourceNodeName = getResourceNodeName();
          m_resourceNode = parent.addElement(resourceNodeName);
          getSaxWriter().writeOpen(m_resourceNode);
  
          if (m_parameters.isRecursive()) {
              String siteRoot = m_cms.getRequestContext().getSiteRoot();
              if (siteRoot.equals("") || siteRoot.equals("/")) {
                  resourcesToExport = CmsFileUtil.removeRedundancies(resourcesToExport);
              } else {
                  // Prevent resources in /system or other sites from being removed when '/' for current site is also selected
                  Map<String, String> rootToSitePaths = new HashMap<>();
                  for (String sitePath : resourcesToExport) {
                      String rootPath = m_cms.addSiteRoot(sitePath);
                      rootToSitePaths.put(rootPath, sitePath);
                  }
                  resourcesToExport = CmsFileUtil.removeRedundancies(
                      new ArrayList<>(rootToSitePaths.keySet())).stream().map(rootToSitePaths::get).collect(
                          Collectors.toList());
  
              }
          }
  
          // distinguish folder and file names
          List<String> folderNames = new ArrayList<String>();
          List<String> fileNames = new ArrayList<String>();
          Iterator<String> it = resourcesToExport.iterator();
          while (it.hasNext()) {
              String resource = it.next();
              if (CmsResource.isFolder(resource)) {
                  folderNames.add(resource);
              } else {
                  fileNames.add(resource);
              }
          }
  
          m_exportedResources = new HashSet<CmsUUID>();
  
          // export the folders
          for (int i = 0; i < folderNames.size(); i++) {
              String path = folderNames.get(i);
              if (m_parameters.isRecursive()) {
                  // first add super folders to the xml-config file
                  addParentFolders(path);
                  addChildResources(path);
              } else {
                  CmsFolder folder;
                  try {
                      folder = getCms().readFolder(path, CmsResourceFilter.IGNORE_EXPIRATION);
                  } catch (CmsException e) {
                      CmsMessageContainer message = Messages.get().container(
                          Messages.ERR_IMPORTEXPORT_ERROR_ADDING_PARENT_FOLDERS_1,
                          path);
                      if (LOG.isDebugEnabled()) {
                          LOG.debug(message.key(), e);
                      }
                      throw new CmsImportExportException(message, e);
                  }
                  CmsResourceState state = folder.getState();
                  long age = folder.getDateLastModified() < folder.getDateCreated()
                  ? folder.getDateCreated()
                  : folder.getDateLastModified();
  
                  if (getCms().getRequestContext().getCurrentProject().isOnlineProject()
                      || (m_parameters.isIncludeUnchangedResources())
                      || state.isNew()
                      || state.isChanged()) {
                      if (!state.isDeleted() && (age >= m_parameters.getContentAge())) {
                          // check if this is a system-folder and if it should be included.
                          String export = getCms().getSitePath(folder);
                          if (checkExportResource(export)) {
                              appendResourceToManifest(folder, true);
                          }
                      }
                  }
              }
          }
          // export the files
          addFiles(fileNames);
  
          // write the XML
          getSaxWriter().writeClose(m_resourceNode);
          parent.remove(m_resourceNode);
          m_resourceNode = null;
      }