The best way to do this sort of thing is with keys. For example if you define the key
<xsl:key name="ItemKey" match="Item" use="@id"/>
then the function call
key('ItemKey', @itemRef)
will find the Item with id=2 when the context node is the first ItemRef in your data sample.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference