open file.xml ; $version := hash ../id /objects/obj/version ; ls /objects/obj[ count(refs/id) and count(refs/id[xsh:lookup('version', .) = ../../version]) = count(refs/id) ];