don't let root objects go out of scope

Similar to m_domNode, we must store a reference to the root object.

We may need the root object to do xpath lookups on child objects, regardless of parent object going out of scope.

The attached test is self-explanatory.