Sure
Suppose your document uses an attribute idref="A B C" to contain a reference to the nodes with id="A", id="B", and id="C".
Then id(//@idref)
will select all the nodes with id's that are referenced in any @idref attribute anywhere in the document.