The challenge is that we have two lists: One of observations (particular lab results) for a particular patient, and the other a set of lab results that mean something (e.g., blood type). The challenge is to find the set of results from the first list that match any of the codes in the second list.
The key is setting up a test of an item against a node list.
If you have in one file:
<code code='interestingCode1' codeSystem='...'/>
<code code='interestingCode2' codeSystem='...'/>
And in another file you have a list of codes:
<RetrieveValueSetResponse ... >
displayName="An Interesting Code Set" version="20061023">
<Concept code="interestingCode1" displayName="Code 1"
<Concept code="interestingCode2" displayName="Code 2"
You can make the second file available through the document function:
And then select the observations using the following expression:
<xsl:for-each select='//cda:observation[cda:code/@code = $InterestingCodes//svs:Concept/@code]'>
Inside the for-each, you'd do something interesting with the matched coded. If you just needed the first on, you could add a  to the end of the expression.
According to XSLT and XPath, this will work because:
If one object to be compared is a node-set and the other is a string, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the string-value of the node and the other string is true.So, that's how you'd do it.