docs: void splitBranches(final Element elem, final Branch filter) {
          final List<Element> ditavalRefs = getChildElements(elem, DITAVAREF_D_DITAVALREF);
          if (ditavalRefs.size() > 0) {
              // remove ditavalrefs
              for (final Element branch: ditavalRefs) {
                  elem.removeChild(branch);
              }
              // create additional branches after current element
              final List<Element> branches = new ArrayList<>(ditavalRefs.size());
              branches.add(elem);
              final Node next = elem.getNextSibling();
              for (int i = 1; i < ditavalRefs.size(); i++) {
                  final Element clone = (Element) elem.cloneNode(true);
                  if (next != null) {
                      elem.getParentNode().insertBefore(clone, next);
                  } else {
                      elem.getParentNode().appendChild(clone);
                  }
                  branches.add(clone);
              }
              // insert ditavalrefs
              for (int i = 0; i < branches.size(); i++) {
                  final Element branch = branches.get(i);
                  final Element ditavalref = ditavalRefs.get(i);
                  branch.insertBefore(ditavalref, branch.getFirstChild());
                  final Branch currentFilter = filter.merge(ditavalref);
                  processAttributes(branch, currentFilter);
                  final Branch childFilter = new Branch(currentFilter.resourcePrefix, currentFilter.resourceSuffix, Optional.empty(), Optional.empty());
                  // process children of all branches
                  for (final Element child: getChildElements(branch, MAP_TOPICREF)) {
                      if (DITAVAREF_D_DITAVALREF.matches(child)) {
                          continue;
                      }
                      splitBranches(child, childFilter);
                  }
              }
          } else {
              processAttributes(elem, filter);
              for (final Element child: getChildElements(elem, MAP_TOPICREF)) {
                  splitBranches(child, filter);
              }
          }
      }