code: private Element rewriteLinks(final Element src) {
          final Element dst = (Element) src.cloneNode(true);
          for (final Element desc: getChildElements(dst, TOPIC_DESC, true)) {
              for (final Element elem: getChildElements(desc, true)) {
                  final Attr href = elem.getAttributeNode(ATTRIBUTE_NAME_HREF);
                  final String scope = elem.getAttribute(ATTRIBUTE_NAME_SCOPE);
                  if (href != null && !scope.equals(ATTR_SCOPE_VALUE_EXTERNAL)) {
                      final URI abs = baseURI.resolve(href.getValue());
                      final URI rel = getRelativePath(currentFile, abs);
                      href.setValue(rel.toString());
                  }
              }
          }
          return dst;
      }
docs: Relativize links