code: @Override
    public final org.jdom2.Element setAttribute(String name, String value, Namespace ns) {
      // remove attribute if value is set to null
      if (value == null) {
        super.removeAttribute(name, ns);
        return this;
      }
      else {
        return super.setAttribute(name, cleanUpString(value), ns);
      }
    }
docs: <p>
  This sets an attribute value for this element. Any existing attribute with the same name and namespace URI is
  removed.
  </p>
  @param name name of the attribute to set
  @param value value of the attribute to set
  @param ns namespace of the attribute to set
  @return this element modified
  @throws org.jdom2.IllegalNameException if the given name is illegal as an attribute name, or if the namespace
  is an unprefixed default namespace
  @throws org.jdom2.IllegalDataException if the given attribute value is illegal character data (as determined
  by {@link org.jdom2.Verifier#checkCharacterData}).
  @throws org.jdom2.IllegalAddException if the attribute namespace prefix collides with another namespace
  prefix on the element.