code: protected String getElementAttribute(Element element, String attrName)
      {
          Attr attr = element.getAttributeNode(attrName);
          return attr != null ? attr.getValue() : null;
      }
docs: Gets the attribute value, or <code>null</code> (unlike <code>Element.getAttribute</code>).