Yes and yes. It's basically a three-table join. The best way to do joins in XSLT is with keys: define a key on the primary-key of the element you want to find, and use the key() function to find it, given the foreign-key in another element.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference