Buggy code:
public class HTMLSerializer extends BaseMarkupSerializer { private static boolean _xhtml ; public static String XHTMLNamespace = "" ; protected HTMLSerializer ( boolean xhtml , OutputFormat format ) { } public HTMLSerializer ( ) { } public HTMLSerializer ( OutputFormat format ) { } public HTMLSerializer ( Writer writer , OutputFormat format ) { } public HTMLSerializer ( OutputStream output , OutputFormat format ) { } public void setOutputFormat ( OutputFormat format ) { } public void startElement ( String namespaceURI , String localName , String rawName , Attributes attrs ) { int i ; boolean preserveSpace ; ElementState state ; String name ; String value ; String htmlName ; boolean addNSAttr = false ; if ( ( _printer ) == null ) throw new IllegalStateException ( "SER002<seq2seq4repair_space>No<seq2seq4repair_space>writer<seq2seq4repair_space>supplied<seq2seq4repair_space>for<seq2seq4repair_space>serializer" ) ; state = getElementState ( ) ; if ( isDocumentState ( ) ) { if ( ! ( _started ) ) startDocument ( ( localName == null ? rawName : localName ) ) ; } else { if ( state . empty ) _printer . printText ( '>' ) ; if ( ( ( _indenting ) && ( ! ( state . preserveSpace ) ) ) && ( ( state . empty ) || ( state . afterElement ) ) ) _printer . breakLine ( ) ; } preserveSpace = state . preserveSpace ; if ( rawName == null ) { rawName = localName ; if ( namespaceURI != null ) { String prefix ; prefix = getPrefix ( namespaceURI ) ; if ( ( prefix . length ( ) ) > 0 ) rawName = ( prefix + ":" ) + localName ; } addNSAttr = true ; } if ( namespaceURI == null ) htmlName = rawName ; else { if ( namespaceURI . equals ( HTMLSerializer . XHTMLNamespace ) ) htmlName = localName ; else htmlName = null ; } _printer . printText ( '<' ) ; if ( HTMLSerializer . _xhtml ) _printer . printText ( rawName . toLowerCase ( ) ) ; else _printer . printText ( rawName ) ; _printer . indent ( ) ; if ( attrs != null ) { for ( i = 0 ; i < ( attrs . getLength ( ) ) ; ++ i ) { _printer . printSpace ( ) ; <START_BUG> name = attrs . getRawName ( i ) . toLowerCase ( ) ; <END_BUG> value = attrs . getValue ( i ) ; if ( ( HTMLSerializer . _xhtml ) || ( namespaceURI != null ) ) { if ( value == null ) { _printer . printText ( name ) ; _printer . printText ( "=\"\"" ) ; } else { _printer . printText ( name ) ; _printer . printText ( "=\"" ) ; printEscaped ( value ) ; _printer . printText ( '"' ) ; } } else { if ( ( value == null ) || ( ( value . length ( ) ) == 0 ) ) _printer . printText ( name ) ; else if ( HTMLdtd . isURI ( rawName , name ) ) { _printer . printText ( name ) ; _printer . printText ( "=\"" ) ; _printer . printText ( escapeURI ( value ) ) ; _printer . printText ( '"' ) ; } else if ( HTMLdtd . isBoolean ( rawName , name ) ) _printer . printText ( name ) ; else { _printer . printText ( name ) ; _printer . printText ( "=\"" ) ; printEscaped ( value ) ; _printer . printText ( '"' ) ; } } } } if ( ( htmlName != null ) && ( HTMLdtd . isPreserveSpace ( htmlName ) ) ) preserveSpace = true ; ( Enumeration ) ++ ; } public void endElement ( String namespaceURI , String localName , String rawName ) { } public void characters ( char [ ] chars , int start , int length ) { } public void startDocument ( ) { } public void startElement ( String tagName , AttributeList attrs ) { } public void endElement ( String tagName ) { } protected void startDocument ( String rootTagName ) { } protected void serializeElement ( Element elem ) { } protected void characters ( String text ) { } protected String getEntityRef ( char ch ) { } protected String escapeURI ( String uri ) { } }

Fix:
name = attrs . getQName ( i ) . toLowerCase ( ) ;