Create documentElement upfront to ensure .childNodes works as expected