Java tutorial
//package com.java2s; public class Main { /** * Same Source String escape(Object text) in com.sec.fs.common.spring.EscapeXmlReference * @param text * @return */ public static String escape(Object text) { return text == null ? null : text.toString().replaceAll("&", "&") // .replaceAll("\"",""") // .replaceAll("\"","'") .replaceAll("<", "<").replaceAll(">", ">"); } }