How to convert string to Node in xslt

ajay bhadauria <[email protected]> Fri, 18 Nov 2011 13:57:28 -0800 (PST)
Newsgroups gmane.text.xml.xalan.java.user
Message-ID <[email protected]>
Hi ,
 
I have a variable in my xslt and based on the value of the variable, I need to select the xpath but the variable is not getting translated to node since it is text. So how I can convert text(string ) to node. Is there any alternate way of doing it ?
 
Regards
Ajay
 
My XSLT is 
 
 <xsl:stylesheet version="1.0" >
 <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
 <xsl:template match="/">
  <xsl:variable name="v1">
   <xsl:for-each select="/SendRequest|/ExchangeRequest">
    <xsl:choose>
     <xsl:when test="(local-name()='SendRequest')">
      <xsl:value-of select="SendRequest"/>
     </xsl:when>
      <xsl:when test="(local-name()='ExchangeRequest')">
      <xsl:value-of select="ExchangeRequest"/>
     </xsl:when>
    </xsl:choose>
   </xsl:for-each>
  </xsl:variable>
  <SwInt:RequestDescriptor>
   <xsl:copy-of select="$v1/Request/RequestHeader"/>
  </SwInt:RequestDescriptor>
 </xsl:template>
</xsl:stylesheet>
 
--------------------------
XML is 
<SendRequest >
 <Request>
  <RequestHeader>
   <Requestor>xyz</Requestor>
   <Responder>abc</Responder>
   <RequestType>test</RequestType>
  </RequestHeader> 
 </Request>
</SendRequest>