XSLT 1.0 deoesn't support dynamic evaluation of xpath expressions
either you need to write a recursive template to parse the xpath string yourself and match the name() against the xpath, or if you are using MSXML3/4 or IE6 , you could do something like