http://www.w3.org/1999/XSL/Transform

c.asString (target : any) : string

The function asString converts any argument into a string representation.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:onion="http://onionworks.net/2004/data" version="1.0">
<xsl:output method="xml" />
<xsl:template match="/">
<xsl:variable name="var">
<html>
<p>Hello World</p>
</html>
</xsl:variable>
<xsl:value-of select="c.asString($var)" />
</xsl:template>
</xsl:stylesheet>
Escaping a nodeset

In this example a variable with some xml data is converted to an escaped string representation. The following output is generated:

&lt;html&gt;&lt;p&gt;Hello World&lt;/p&gt;&lt;/html&gt;