Currently getHarvestFromDocument() generates a set of XML strings which are concatenated to obtain the final harvest. Instead, this should be handled through an xmlTextWriter() and the writerContext should be passed to getHarvestFromDocument (which would become more of a writeDocumentToHarvest()).
Currently getHarvestFromDocument() generates a set of XML strings which are concatenated to obtain the final harvest. Instead, this should be handled through an xmlTextWriter() and the writerContext should be passed to getHarvestFromDocument (which would become more of a writeDocumentToHarvest()).
[1] http://xmlsoft.org/html/libxml-xmlwriter.html