code: public static String getElementTagName(final Node aNode) {
  
          if (aNode != null && aNode.getNodeType() == Node.ELEMENT_NODE) {
  
              final Element theElement = (Element) aNode;
              return theElement.getTagName();
          }
  
          // The Node was not an Element.
          return null;
      }
docs: Retrieves the TagName for the supplied Node if it is an Element, and null otherwise.
  
  @param aNode A DOM Node.
  @return The TagName of the Node if it is an Element, and null otherwise.