modified IE7-8 codepath to use document.documentElement (which works at parse time)