Add startDocument and endDocument calls