question: public static String makeXmlSafe ( String text ) { if ( StringUtil . isNullOrEmpty ( text ) ) return "" ; text = text . replace ( ESC_AMPERSAND , "&" ) ; text = text . replace ( "\"" , ESC_QUOTE ) ; text = text . replace ( "&" , ESC_AMPERSAND ) ; text = text . replace ( "'" , ESC_APOSTROPHE ) ; text = text . replace ( "<" , ESC_LESS_THAN ) ; text = text . replace ( ">" , ESC_GREATER_THAN ) ; text = text . replace ( "" , " " ) ; return text ; }
target:  Takes in a string, and replaces all XML special characters with the approprate escape strings.