question: public static String encodeXML ( String text ) { if ( text == null ) { return null ; } final StringBuilder result = new StringBuilder ( ) ; final StringCharacterIterator iterator = new StringCharacterIterator ( text ) ; char character = iterator . current ( ) ; while ( character != CharacterIterator . DONE ) { if ( character == '<' ) { result . append ( "&lt;" ) ; } else if ( character == '>' ) { result . append ( "&gt;" ) ; } else if ( character == '\"' ) { result . append ( "&quot;" ) ; } else if ( character == '\'' ) { result . append ( "&#039;" ) ; } else if ( character == '&' ) { result . append ( "&amp;" ) ; } else { result . append ( character ) ; } character = iterator . next ( ) ; } return result . toString ( ) ; }
target:  Escape characters for text appearing as XML data, between tags. The following characters are replaced : <br> < <br> > <br> & <br> " <br> '