Here you can find the source of unescapeXml(String value)
public static String unescapeXml(String value)
//package com.java2s; /*//from w ww .j a v a2 s . c om * Copyright (C) 2006-2016 Talend Inc. - www.talend.com * * This source code is available under agreement available at * %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt * * You should have received a copy of the agreement along with this program; if not, write to Talend SA 9 rue Pages * 92150 Suresnes, France */ public class Main { public static String unescapeXml(String value) { if (value != null) { StringBuilder result = new StringBuilder(value.length()); int i = 0; int n = value.length(); while (i < n) { char charAt = value.charAt(i); if (charAt != '&') { result.append(charAt); i++; } else { if (value.startsWith("&", i)) { //$NON-NLS-1$ result.append('&'); i += 5; } else if (value.startsWith("'", i)) { //$NON-NLS-1$ result.append('\''); i += 6; } else if (value.startsWith(""", i)) { //$NON-NLS-1$ result.append('"'); i += 6; } else if (value.startsWith("<", i)) { //$NON-NLS-1$ result.append('<'); i += 4; } else if (value.startsWith(">", i)) { //$NON-NLS-1$ result.append('>'); i += 4; } } } return result.toString().replaceAll("\t", "").replaceAll("\n", "").replaceAll("\r", ""); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$//$NON-NLS-6$ } else { return null; } } }