code: public static URI setElementID(final URI relativePath, final String id) {
          String topic = getTopicID(relativePath);
          if (topic != null) {
              return setFragment(relativePath, topic + (id != null ? SLASH + id : ""));
          } else if (id == null) {
              return stripFragment(relativePath);
          } else {
              throw new IllegalArgumentException(relativePath.toString());
          }
      }
docs: Set the element ID from the path
  
  @param relativePath path
  @param id element ID
  @return element ID, may be {@code null}