Here you can find the source of quoteForXML(String from)
public static String quoteForXML(String from)
//package com.java2s; //License from project: Open Source License public class Main { public static String quoteForXML(String from) { String to = from.replace("&", "&"); //$NON-NLS-1$ //$NON-NLS-2$ to = to.replace("<", "<"); //$NON-NLS-1$ //$NON-NLS-2$ to = to.replace(">", ">"); //$NON-NLS-1$ //$NON-NLS-2$ to = to.replace("'", "'"); //$NON-NLS-1$ //$NON-NLS-2$ to = to.replace("\"", """); //$NON-NLS-1$ //$NON-NLS-2$ return to; }/*from w w w. java2s . c o m*/ }