public void testPrintStackTrace() {
XMLException ex = new XMLException(message, cause);
StringWriter out = new StringWriter();
PrintWriter pw = new PrintWriter(out);
ex.printStackTrace(pw);
pw.close();
assertTrue(out.toString().indexOf("Caused by: ") > 0);
}