public void serializeAttributes(BeanT bean, XMLSerializer target)
      throws SAXException, IOException, XMLStreamException {
    for (AttributeProperty<BeanT> p : attributeProperties)
      try {
        if (retainPropertyInfo) {
          final Property parentProperty = target.getCurrentProperty();
          target.currentProperty.set(p);
          p.serializeAttributes(bean, target);
          target.currentProperty.set(parentProperty);
        } else {
          p.serializeAttributes(bean, target);
        }
        if (p.attName.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE, "nil")) {
          isNilIncluded = true;
        }
      } catch (AccessorException e) {
        target.reportError(null, e);
      }

    try {
      if (inheritedAttWildcard != null) {
        Map<QName, String> map = inheritedAttWildcard.get(bean);
        target.attWildcardAsAttributes(map, null);
      }
    } catch (AccessorException e) {
      target.reportError(null, e);
    }
  }