docs: private static String resolveURI(final URL baseURI, final Parent parent, String url) {
          url = url.equals(".") || url.equals("./") ? "" : url;
          if (isRelativeURI(url) && parent != null && parent instanceof Element) {
              final Attribute baseAtt = ((Element) parent).getAttribute("base", Namespace.XML_NAMESPACE);
              String xmlBase = baseAtt == null ? "" : baseAtt.getValue();
              if (!isRelativeURI(xmlBase) && !xmlBase.endsWith("/")) {
                  xmlBase = xmlBase.substring(0, xmlBase.lastIndexOf("/") + 1);
              }
              return resolveURI(baseURI, parent.getParent(), xmlBase + url);
          } else if (isRelativeURI(url) && parent == null) {
              return baseURI + url;
          } else if (baseURI != null && url.startsWith("/")) {
              String hostURI = baseURI.getProtocol() + "://" + baseURI.getHost();
              if (baseURI.getPort() != baseURI.getDefaultPort()) {
                  hostURI = hostURI + ":" + baseURI.getPort();
              }
              return hostURI + url;
          }
          return url;
      }