code: @SuppressWarnings( "unchecked" )
      @Override
      protected void writeClass( Class cls, final XMLStreamWriter writer, final boolean useAttributes ) throws XMLStreamException {
  
          if ( Proxy.isProxyClass( cls ) ) {
              cls = Proxy.class;
          }
  
          CustomXMLFormat<?> xmlFormat = null;
          if ( ( xmlFormat = getCustomFormat( cls ) ) != null ) {
              cls = xmlFormat.getTargetClass( cls );
          }
  
          if ( useAttributes ) {
              writer.writeAttribute( CLASS, cls.getName() );
          } else {
              writer.writeStartElement( cls.getName() );
          }
  
      }
docs: {@inheritDoc}