CAN THIS BE IMPROVED ON?
============================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="C:\Program Files\Altova\XML Spy Suite\Examples\nmtokens.xsl"?>
<surgery>
<!-- should not pad with more than a single space between tokens and no leading or trailing spaces -->
<human bodyparts="arm leg head"/>
</surgery>
============================
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="
<xsl

utput method="xml" version="1.0" encoding="ISO-8859-1" omit-xml-declaration="no" indent="no" media-type="text/html"/>
<xsl:template name="each_nmtoken">
<xsl

aram name="nmtokens"/>
[<xsl:value-of select="substring-before($nmtokens, ' ')"/>]<br/>
<xsl:if test="string-length($nmtokens) > 0">
<!-- remainder of string is [<xsl:value-of select="substring-after($nmtokens, ' ')"/>]<br/> -->
<xsl:choose>
<xsl:when test="substring-after(substring-after($nmtokens, ' '), ' ') != ''">
<xsl:call-template name="each_nmtoken">
<xsl:with-param name="nmtokens" select="substring-after($nmtokens, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl

therwise>
[<xsl:value-of select="substring-after($nmtokens, ' ')"/>]<br/>
</xsl

therwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="/">
<html>
<head>
<title>
test
</title>
</head>
<body>
<h2>
<xsl:call-template name="each_nmtoken">
<xsl:with-param name="nmtokens" select="//surgery/human/@bodyparts"/>
</xsl:call-template>
</h2>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
============================