If head doesn't exist, default to documentElement.