Move test for START_DOCUMENT event to the last item checked since it is the least frequent