// cache the document
String docid = collection.getAbsolutePath() + File.separatorChar + docName;
DocumentTableLoader.putDocumentIfAbsent(docid, doc);
SaxWriter writer = new SaxWriter();
ContentHandler builder = new DocumentTableBuilder(doc);
writer.setContentHandler(builder);
xstream.marshal(value, writer);
writer.flush();