I can't really tell what you are trying to do so I can't correct your code but perhaps I can explain why it is obviously wrong. The expression
select="//ServiceRequestTemplate[@TemplateSet=text()]"
would only select elements like this:
<ServiceRequestTemplate TemplateSet="ABCDE">ABCDE</ServiceRequestTemplate>
that is elements whose content is equal to the value of their TemplateSet attribute. That would seem an unusual thing to want to do.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference