docs: private static void setUniqueIdReferences(final Node node, final String id, final String fixedId) {
          final NamedNodeMap attributes = node.getAttributes();
          if (attributes != null) {
              for (int i = 0; i < attributes.getLength(); ++i) {
                  final Attr attr = (Attr) attributes.item(i);
                  // Ignore id attributes, as we only care about references (ie linkend)
                  if (!(attr.getName().equalsIgnoreCase("id") || attr.getName().equalsIgnoreCase("xml:id"))) {
                      final String attributeValue = attr.getValue();
                      if (attributeValue.equals(id)) {
                          attributes.item(i).setNodeValue(fixedId);
                      }
                  }
              }
          }
  
          final NodeList elements = node.getChildNodes();
          for (int i = 0; i < elements.getLength(); ++i) {
              setUniqueIdReferences(elements.item(i), id, fixedId);
          }
      }