code: private static void addAttribute(final AttributesImpl attributes, final String attrName, final String attrValue) {
      if (attrName == null) {
        throw new IllegalArgumentException("attrName");
      }
      if (attrValue != null) {
        attributes.addAttribute(null, attrName, attrName, "#PCDATA", attrValue);
      }
    }
docs: Adds an non-namespace-qualified attribute to attribute list.
  
  @param attributes
  list of attributes.
  @param attrName
  attribute name, may not be null.
  @param attrValue
  attribute value, if null attribute is not added.