// Not sure why we need to do the next two lines:
xcasSerializer.setDocumentTypeName(Constants.VINCI_DETAG);
xcasSerializer.setDocumentTextFeature(null);
XTalkSerializer s = new XTalkSerializer(os, xcasSerializer);
try {
xcasSerializer.serialize(myCas, s, includeDocText, outOfTypeSystemData);
} catch (org.xml.sax.SAXException e) {
//if SAXException wraps an IOException, throw the IOException. This is
//important since different types of IOExceptions (e.g. SocketTimeoutExceptions)
//are treated differently by Vinci
throw convertToIOException(e);