resolves issue #166 by adding returning type Document in process method of TreeProcessor.