XmlUtil { public static String xmlToPlainText(String conc) { return xmlToPlainText(conc, false); }  static boolean isNamespaceAware(); static void setNamespaceAware(boolean namespaceAware); static Document parseXml(Reader reader); static String xmlToPlainText(String conc); static String xmlToPlainText(String conc, boolean makeNonBreaking); static String readXmlAndResolveReferences(BufferedReader reader);  }
@Test public void testXmlToPlainText() { Assert.assertEquals("test test test", XmlUtil.xmlToPlainText("test <bla>test</bla> test")); Assert.assertEquals("test > test", XmlUtil.xmlToPlainText("test &gt; test")); Assert.assertEquals("test A test", XmlUtil.xmlToPlainText("test &#65; test")); Assert.assertEquals("test B test", XmlUtil.xmlToPlainText("test &#x42; test")); Assert.assertEquals("test test", XmlUtil.xmlToPlainText("test <bla test=\"&quot;\" > test")); Assert.assertEquals("test test", XmlUtil.xmlToPlainText("test\ntest")); Assert.assertEquals(" test test", XmlUtil.xmlToPlainText("\t\ttest \n\rtest")); Assert.assertEquals("test\u00A0test", XmlUtil.xmlToPlainText("test test", true)); Assert.assertEquals("test\u00A0test\u00A0", XmlUtil.xmlToPlainText("test test ", true)); }