private static String escapeXml ( String input ) { return input == null ? "" : input . replace ( "&" , "&amp;" ) . replace ( "<" , "&lt;" ) . replace ( ">" , "&gt;" ) ; }
Converts the incoming string to an escaped output string . This method is far from perfect only escaping &lt ; &gt ; and &amp ; characters