}
// check referential integrity ...
referrers.removeAll(removedNodes);
if (!referrers.isEmpty()) {
throw new ReferentialIntegrityException(removedNodes, referrers);
}
// Now remove all of the nodes from the documentStore.
// Note 2: we do this last because the children are removed from their parent before the removal is handled above
// (see Node 1), meaning getting the path and other information for removed nodes never would work properly.