You display spaces due to the way XML is formatted. You can fix this in two ways. One of them is simply to remove the formatting:
<xsl:for-each select="valueinElement"><xsl:value-of select="@attributeValue"/>,</xsl:for-each>
Another, more reliable way is to change the way you handle spaces:
<xsl:for-each select="valueinElement">
<xsl:value-of select="@attributeValue"/>
<xsl:text>,</xsl:text>
</xsl:for-each>
, , - , , for-each .
XSLT XML:
<root>
<valueinElement attributeValue="dogs"/>
<valueinElement attributeValue="cats"/>
<valueinElement attributeValue="mice"/>
<valueinElement attributeValue="lasers"/>
<valueinElement attributeValue="frogs"/>
</root>
:
dogs,cats,mice,lasers,frogs