NXP-11348: Fix hard-coded Domain reference

Updated fix for https://jira.nuxeo.com/browse/NXP-11348

This time, getPathFragments() looks for a Domain or a subtype of Domain. I left a test for the root path to avoid infinite loops in all situations (e.g. a publication tree not based on a domain).