BufferedWriter writer = null;
try {
writer = new BufferedWriter(new FileWriter(
xmiOutputDirectory + File.separatorChar
+ documentID.toString() + ".xmi"));
XmiCasSerializer ser = new XmiCasSerializer(
jcas.getTypeSystem());
XMLSerializer xmlSer = new XMLSerializer(writer, false);
ser.serialize(jcas.getCas(), xmlSer.getContentHandler());
} catch (IOException e) {
log.error("error writing xmi, documentID=" + documentID, e);
} catch (SAXException e) {
log.error("error writing xmi, documentID=" + documentID, e);
} finally {