XmlSanitizer { public static String unescapeXml(final String s) { if (s == null) return ""; String result; result = s.replaceAll("&lt;","<"); result = result.replaceAll("&gt;",">"); result = result.replaceAll("&quot;","\""); result = result.replaceAll("&apos;","'"); result = result.replaceAll("&amp;","&"); return result; }  static String sanitize(final String input, final String tag); static String escapeXml(final String s); static String unescapeXml(final String s);  }
@Test public void unescapeBoincNewVersion() { String unescaped = XmlSanitizer.unescapeXml(sanitizedText1); assertThat(unescaped, is(equalTo(rawText1))); }
@Test public void unescapeAllSupported() { String sanitized = XmlSanitizer.unescapeXml(allSanitizedChars); assertThat(sanitized, is(equalTo(allUnsafeChars))); }