code: public static String getAttributeValueOrNull(final Node elementNode, final String attrName)
      {
          if (null == elementNode || null == elementNode.getAttributes())
          {
              return null;
          }
  
          final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);
          if (null == attrNode)
          {
              return null;
          }
  
          return attrNode.getNodeValue();
      }
docs: Helper function that hides the null return from {@link org.w3c.dom.NamedNodeMap#getNamedItem(String)}
  
  @param elementNode that could be null
  @param attrName    that is to be looked up
  @return null or value of the attribute