I need to be able to select the root element from a fragment without knowing the node types, class, id or hierachy.
If you want to select the top level parent of an element but still under the body, I'd go
$(obj).parents().filter('body > *')