Tree builder: document parser