title: how to convert xslt version 2.0 to version 1.0
body: <p>i am using xslt document which uses xpath version 2 functions. I only have xalan 2.6 jar which has xslt 1.0 processor, its a constraint i cannot change it..please help me if there are any tools that convert xpath 2.0 functions to 1.0</p>
  
  <pre><code>&lt;xsl:variable name="var1_ClinicalDocument" as="node()?" select="ns0:ClinicalDocument"/&gt;
          &lt;DSMessage&gt;
              &lt;DSPatient&gt;
                  &lt;xsl:for-each 
  
      select="$var1_ClinicalDocument[fn:exists(ns0:id/@root)]"&gt;
                          &lt;Source&gt;
                              &lt;xsl:sequence select="fn:string(ns0:id/@root)"/&gt;
                          &lt;/Source&gt;
                      &lt;/xsl:for-each&gt;
                      &lt;Demographics&gt;
                          &lt;xsl:for-each select="($var1_ClinicalDocument/ns0:recordTarget/ns0:patientRole/ns0:id)[fn:exists(@extension)]"&gt;
                              &lt;externalID&gt;
                                  &lt;xsl:sequence select="fn:string(@extension)"/&gt;
                              &lt;/externalID&gt;
                          &lt;/xsl:for-each&gt;
                          &lt;xsl:for-each select="($var1_ClinicalDocument/ns0:recordTarget/ns0:patientRole/ns0:patient/ns0:name/ns0:given/node())[fn:boolean(self::text())]"&gt;
                              &lt;firstName&gt;
                                  &lt;xsl:sequence select="fn:string(.)"/&gt;
                              &lt;/firstName&gt;
  </code></pre>