Should you need to locate a node some other place in a document, via some sort of a reference by an identifier, be sure to use the interface provided by the id-lookup-by-name named template. It accepts a string (the value of the identifier in the reference) and returns an xml:id value that can be used with the XSL id() function to return the desired node (as a node-set). Use a pattern such as the following, paying particular attention to the name of the variable supplied to the id() function.
<xsl:variable name="target-id">