XmlStringUtil { public static String removeTags(String document) { return document.replaceAll("<.*?>", ""); }  static String removeAllNsPrefixes(String xmlString); static String removeTags(String document);  }
@Test public void testRemoveTags() { final String ORIGINAL = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><root><elem attr1=\"value1\" b-attr1=\"value2\">content</elem></root>"; final String EXPECTED = "content"; assertEquals(EXPECTED, XmlStringUtil.removeTags(ORIGINAL)); assertEquals("", XmlStringUtil.removeTags("")); assertEquals("Ne moc XML s tucnym textem.", XmlStringUtil.removeTags("<p>Ne moc XML s <b>tucnym</b> textem.</p>")); }