code: public void writeAttribute(String name, Object value)
    {
      if (!_isElementOpen)
        throw new IllegalStateException("no open element");
  
      if (value == null)
        return;
  
      _isElementOpen = false;
      try {
        _strategy.writeAttribute(this, name, value);
      }
      finally {
        _isElementOpen = true;
      }
  
    }
docs: Write an attribute with a value, if value is null nothing is written.
  
  @throws IllegalStateException if the is no element is open