public void testEscapeCData() throws Exception {
StringWriter result = new StringWriter();
XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
writer.writeStartDocument();
writer.writeStartElement("alice");
writer.writeCData("<>&\"'");
writer.writeEndElement();
writer.writeEndDocument();
writer.close();
Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><alice><![CDATA[<>&\"']]></alice>", result.toString());
}