Emit start/endDocument calls

Change-Id: Ic8413c9f24a0fa06ed6bbb24d1be8dd638b176aa