Android examples for XML:XML String Escape
escape XML Element Value
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { String unescaped = "java2s.com"; System.out.println(escapeElementValue(unescaped)); }/*from ww w .j a va 2 s. c o m*/ public static String escapeElementValue(String unescaped) { return unescaped.replace("&", "&").replace("<", "<") .replace(">", ">").replace("'", "'") .replace("\"", """); } }