Something like this, perhaps:
Code:
<xsl:template match="/">
<xsl:variable name="post-replacement">
<xsl:apply-templates select="." mode="replace"/>
</xsl:variable>
... next phase of processing ...
</xsl:template>
<xsl:template match="*" mode="replace">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="replace"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()" mode="replace">
<xsl:value-of select="replace(., 'abc', 'def')"/>
</xsl:template>