The following is the complete example containing both XML and XSLT where substring-before and substring-after are used
<?xml version="1.0" encoding="UTF-8"?>
<persons name="Group_SOEM">
<person>
<first>Joe Smith</first>
<last>Joe Smith</last>
<address>123 Main St, Anycity</address>
</person>
</persons>
The following is XSLT which changes value of first/last name by separating the value by space so that after applying this XSL the first name element will have value "Joe" and last "Smith".
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="first">
<first>
<xsl:value-of select="substring-before(.,' ')" />
</first>
</xsl:template>
<xsl:template match="last">
<last>
<xsl:value-of select="substring-after(.,' ')" />
</last>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>