code: private static @Nonnull Map<String, String> attributesToMap(NamedNodeMap nnm) {
          return IntStream.range(0, nnm.getLength())
                      .mapToObj(nnm::item)
                      .collect(toMap(Node::getNodeName, Node::getNodeValue));
      }
docs: Converts a {@link NamedNodeMap} to a standard {@link Map} of attributes.
  
  @param nnm {@link NamedNodeMap} to convert
  @return {@link Map} of attributes and their values