Make sure to pass scalar values as external parameters to style sheets. Don't send XPath queries as parameters---especially an XPath query with a predicate like this:
/plays/playwright[last_name='Shakespeare']
It is better to just send the scalar text value:
'Shakespeare'
The MSXML engine, for example, will 'silently' fail providing no clues whatsoever about its type-resolution problems. Avoid the entangling mystery and keep it simple.