code: public Map<String, String> getAttributes()
      {
          final NamedNodeMap map = root.getAttributes();
          final int length = map.getLength();
          final Map<String, String> attributes = new HashMap<>(length);
          for (int i = 0; i < length; i++)
          {
              final Node node = map.item(i);
              attributes.put(node.getNodeName(), node.getNodeValue());
          }
          return attributes;
      }
docs: Get all attributes.
  
  @return The attributes map reference.