I have a node in my XML file containing the following:
I wish to take this line and replace it w
You'll better pass the current data as an input / xsl:param to the template.
The XSLT aims to be purely functional language; that is, all templates / functions should conform to e.g. the following condition: If a pure function is called with parameters that cause no side-effects, the result is constant with respect to that parameter list (sometimes called referential transparency), i.e. if the pure function is again called with the same parameters, the same result will be returned (this can enable caching optimizations such as memoization).
Although there are workarounds on this (as InfantPro'Aravind' pointed out), it is not recommended to do such things; by doing it, you're ruining one of the most significant XSLT benefits.