docs: private String getRecursiveString() {
          final StringBuilder outBuilder = new StringBuilder();
          if (!namespace.isEmpty()) {
              outBuilder.append(namespace).append("\n");
          }
          if (!qvarMapVariable.isEmpty() && addQvarMap) {
              outBuilder.append(qvarMapVariable).append("\n");
          }
  
          outBuilder.append("\ndeclare function local:compareApply($rootApply, $depth, $x ) {\n")
                  .append("(for $child in $x/* return local:compareApply(\n")
                  .append("if (empty($rootApply) and $child/name() = \"apply\") then $child else $rootApply,\n")
                  .append("if (empty($rootApply) and $child/name() = \"apply\") then 0 else $depth+1, $child),\n")
                  .append("if ($x/name() = \"apply\"\n")
                  .append(" and $x").append(exactMatchXQuery).append("\n");
          if (!lengthConstraint.isEmpty()) {
              outBuilder.append(" and ").append(lengthConstraint).append("\n");
          }
          if (!qvarConstraint.isEmpty()) {
              outBuilder.append(" and ").append(qvarConstraint).append("\n");
          }
          outBuilder.append(" ) then\n")
                  .append(returnFormat).append("\n")
                  .append("else ()\n")
                  .append(")};\n\n")
                  .append("for $m in ").append(pathToRoot).append(" return\n")
                  .append("local:compareApply((), 0, $m)");
  
          return outBuilder.toString();
      }