throws Exception {
Writer writer = new StringWriter();
try {
XMLSerializer xmlSer = new XMLSerializer(writer, false);
XmiCasSerializer ser = new XmiCasSerializer(aCAS.getTypeSystem());
ser.serialize(aCAS, xmlSer.getContentHandler(), null, serSharedData, aMarker);
return writer.toString();
} catch (SAXException e) {
throw e;
} finally {
writer.close();