question: @ Override public void escape ( char [ ] buffer , int start , int length , boolean isAttributeValue , Writer outputWriter ) throws IOException { for ( int i = start ; i < start + length ; i ++ ) { char ch = buffer [ i ] ; if ( ch == '&' ) { outputWriter . write ( "&amp;" ) ; continue ; } if ( ch == '<' ) { outputWriter . write ( "&lt;" ) ; continue ; } if ( ch == '>' ) { outputWriter . write ( "&gt;" ) ; continue ; } if ( ch == '"' && isAttributeValue ) { outputWriter . write ( "&quot;" ) ; continue ; } if ( ch == '\'' && isAttributeValue ) { outputWriter . write ( "&apos;" ) ; continue ; } if ( isXml11RestrictedCharacter ( ch ) ) { outputWriter . write ( "&#x" ) ; outputWriter . write ( Integer . toHexString ( ch ) ) ; outputWriter . write ( ";" ) ; continue ; } outputWriter . write ( ch ) ; } }
target:  Escape restricted XML 1.1 characters inside the buffer and send the output to the Writer. The "&", "<", and ">" characters are always escaped. Single and double quotes are escaped when within an attribute. All XML 1.1 restricted characters are escaped using "&#x(value);".