This can be achieved in XSLT 1.0 using quite tricky recursive processing.
Fortunately, one can use FXSL ( a library of XSLT templates) to solve the same task in just a few minutes:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:f="http://fxsl.sf.net/"
xmlns:testmap="testmap"
exclude-result-prefixes="xsl f testmap">
<xsl:import href="str-dvc-map.xsl"/>
<testmap:testmap/>
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<xsl:variable name="vTestMap" select="document('')/*/testmap:*[1]"/>
<xsl:call-template name="str-map">
<xsl:with-param name="pFun" select="$vTestMap"/>
<xsl:with-param name="pStr" select="/*/text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="escape" mode="f:FXSL"
match="*[namespace-uri() = 'testmap']">
<xsl:param name="arg1"/>
<xsl:choose>
<xsl:when test="$arg1 = '<'">&lt;</xsl:when>
<xsl:when test="$arg1 = '>'">&gt;</xsl:when>
<xsl:otherwise><xsl:value-of select="$arg1"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
when this transformation is applied on the following XML document:
<one>
<text>
</one>
the wanted result is produced:
&lt;text&gt;
and it displays in the browser as: <text>