Fix #80927: Removing documentElement after creating attribute node: possible use-after-free Closes GH-11892.