docs: private Element createDeepElementCopyInternal(
          String parentPath,
          Element parent,
          Element element,
          Set<String> copyElements) {
  
          String elName = element.getName();
          if (parentPath != null) {
              Element first = element.getParent().element(elName);
              int elIndex = (element.getParent().indexOf(element) - first.getParent().indexOf(first)) + 1;
              elName = parentPath + (parentPath.length() > 0 ? "/" : "") + elName.concat("[" + elIndex + "]");
          }
  
          if ((parentPath == null) || copyElements.contains(elName)) {
              // this is a content element we want to copy
              Element copy = element.createCopy();
              // copy.detach();
              if (parentPath != null) {
                  parent.add(copy);
              }
  
              // check if we need to copy subelements, too
              boolean copyNested = (parentPath == null);
              for (Iterator<String> i = copyElements.iterator(); !copyNested && i.hasNext();) {
                  String path = i.next();
                  copyNested = !elName.equals(path) && path.startsWith(elName);
              }
  
              if (copyNested) {
                  copy.clearContent();
                  for (Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(element); i.hasNext();) {
                      Element el = i.next();
                      createDeepElementCopyInternal((parentPath == null) ? "" : elName, copy, el, copyElements);
                  }
              }
  
              return copy;
          } else {
              return null;
          }
      }