Buggy code:
switch ( code ) { case NodeFilter . FILTER_REJECT : case NodeFilter . FILTER_SKIP : { break ; } default : { characters ( text ) ; } } } else if ( ( ( ! ( _indenting ) ) || ( getElementState ( ) . preserveSpace ) ) || ( ( text . replace ( '\n' , '<seq2seq4repair_space>' ) . trim ( ) . length ( ) ) != 0 ) ) characters ( text ) ; } break ; } case Node . CDATA_SECTION_NODE : { String text ; text = node . getNodeValue ( ) ; if ( text != null ) { if ( ( ( fDOMFilter ) != null ) && ( ( ( fDOMFilter . getWhatToShow ( ) ) & ( NodeFilter . SHOW_CDATA_SECTION ) ) != 0 ) ) { short code = fDOMFilter . acceptNode ( node ) ; switch ( code ) { case NodeFilter . FILTER_REJECT : case NodeFilter . FILTER_SKIP : { return ; } default : { } } } startCDATA ( ) ; characters ( text ) ; endCDATA ( ) ; } break ; } case Node . COMMENT_NODE : { String text ; if ( ! ( _format . getOmitComments ( ) ) ) { text = node . getNodeValue ( ) ; if ( text != null ) { if ( ( ( fDOMFilter ) != null ) && ( ( ( fDOMFilter . getWhatToShow ( ) ) & ( NodeFilter . SHOW_COMMENT ) ) != 0 ) ) { short code = fDOMFilter . acceptNode ( node ) ; switch ( code ) { case NodeFilter . FILTER_REJECT : case NodeFilter . FILTER_SKIP : { return ; } default : { } } } comment ( text ) ; } } break ; } case Node . ENTITY_REFERENCE_NODE : { Node child ; endCDATA ( ) ; content ( ) ; if ( ( ( fDOMFilter ) != null ) && ( ( ( fDOMFilter . getWhatToShow ( ) ) & ( NodeFilter . SHOW_ENTITY_REFERENCE ) ) != 0 ) ) { short code = fDOMFilter . acceptNode ( node ) ; switch ( code ) { case NodeFilter . FILTER_REJECT : { return ; } case NodeFilter . FILTER_SKIP : { child = node . getFirstChild ( ) ; while ( child != null ) { serializeNode ( child ) ; child = child . getNextSibling ( ) ; } return ; } default : { child = node . getFirstChild ( ) ; if ( child != null ) { _printer . printText ( "&" ) ; _printer . printText ( node . getNodeName ( ) ) ; _printer . printText ( ";" ) ; } return ; } } } child = node . getFirstChild ( ) ; if ( ( child == null ) || ( ( ( fFeatures ) != null ) && ( getFeature ( DOM_ENTITIES ) ) ) ) { _printer . printText ( "&" ) ; _printer . printText ( node . getNodeName ( ) ) ; _printer . printText ( ";" ) ; } else { while ( child != null ) { serializeNode ( child ) ; child = child . getNextSibling ( ) ; } } break ; } case Node . PROCESSING_INSTRUCTION_NODE : { if ( ( ( fDOMFilter ) != null ) && ( ( ( fDOMFilter . getWhatToShow ( ) ) & ( NodeFilter . SHOW_PROCESSING_INSTRUCTION ) ) != 0 ) ) { short code = fDOMFilter . acceptNode ( node ) ; switch ( code ) { case NodeFilter . FILTER_REJECT : case NodeFilter . FILTER_SKIP : { return ; } default : { } } } processingInstructionIO ( node . getNodeName ( ) , node . getNodeValue ( ) ) ; break ; } case Node . ELEMENT_NODE : { <START_BUG> if ( ( ( fDOMFilter ) != null ) && ( ( ( fDOMFilter . getWhatToShow ( ) ) & ( NodeFilter . SHOW_PROCESSING_INSTRUCTION ) ) != 0 ) ) { <END_BUG> short code = fDOMFilter . acceptNode ( node ) ; switch ( code ) { case NodeFilter . FILTER_REJECT : { return ; } case NodeFilter . FILTER_SKIP : { Node child = node . getFirstChild ( ) ; while ( child != null ) { serializeNode ( child ) ; child = child . getNextSibling ( ) ; } return ; } default : { } } } serializeElement ( ( ( Element ) ( node ) ) ) ; break ; } case Node . DOCUMENT_NODE : { DocumentType docType ; DOMImplementation domImpl ; NamedNodeMap map ; Entity entity ; Notation notation ; int i ; docType = ( ( Document ) ( node ) ) . getDoctype ( ) ; if ( docType != null ) { domImpl = ( ( Document ) ( node ) ) . getImplementation ( ) ; try { String internal ; _printer . enterDTD ( ) ; _docTypePublicId = docType . getPublicId ( ) ; _docTypeSystemId = docType . getSystemId ( ) ; internal = docType . getInternalSubset ( ) ; if ( ( internal != null ) && ( ( internal . length ( ) ) > 0 ) ) _printer . printText ( internal ) ; endDTD ( ) ; } catch ( NoSuchMethodError nsme ) { Class docTypeClass = docType . getClass ( ) ; String docTypePublicId = null ; String docTypeSystemId = null ; try { Method getPublicId = docTypeClass . getMethod ( "getPublicId" , null ) ; if ( getPublicId . getReturnType ( ) . equals ( String . class ) ) { docTypePublicId = ( ( String ) ( getPublicId . invoke ( docType , null ) ) ) ; } } catch ( Exception e ) { }

Fix:
if ( ( ( fDOMFilter ) != null ) && ( ( ( fDOMFilter . getWhatToShow ( ) ) & ( NodeFilter . SHOW_ELEMENT ) ) != 0 ) ) {