code: private void handleTypeAndAttributes(Node node, Map<String, Object> elementMap) {
          // Set type
          if (node.getLocalName() != null) {
              elementMap.put("_type", node.getLocalName());
          }
  
          // Set the attributes
          if (node.getAttributes() != null) {
              NamedNodeMap attributeMap = node.getAttributes();
              for (int i = 0; i < attributeMap.getLength(); i++) {
                  Node attribute = attributeMap.item(i);
                  elementMap.put(attribute.getNodeName(), attribute.getNodeValue());
              }
          }
      }
docs: Collects type and attributes for the node
  
  @param node
  @param elementMap