Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static final String SPACE = " "; public static final String QUOTE = "\""; public static final String GT = ">"; public static final String GT_A = ">"; public static final String LT = "<"; public static final String LT_A = "<"; public static final String QUOTE_A = """; public static final String APOS = "'"; public static final String APOS_A = "'"; public static final String AND = "&"; public static final String AND_A = "&"; public static final String NBSP_A = " "; public static String decodeXML(final String xML) { String result = xML.replaceAll(LT_A, LT); result = result.replaceAll(GT_A, GT); result = result.replaceAll(QUOTE_A, QUOTE); result = result.replaceAll(APOS_A, APOS); result = result.replaceAll(AND_A, AND); result = result.replaceAll(NBSP_A, SPACE); return result; } }