Implements stream-based document construction