Adding Spaces to XSL Transform

So, you want to add some spaces to your XSLT, shouldn't be a big deal right? Well, the first thing I'd try is:

<xsl:text> </xsl:text>

Oh, but that's right, we're generating HTML as the output, so you need to use some &nsbp; characters to acutally get the spaces to show up:

<xsl:text>,&nbsp;</xsl:text>

Phew, don...oh...that doesn't validate?

reference to undeclared entity 'nsbp'. Line blah...

Hmmm, so what is expected here then? Well it's actually expecting the HTML hexidecimal entity representation of the &nsbp; character, which happens to be &#xA0; (I know that thanks to http://www.fileformat.info/info/unicode/char/a0/index.htm):

<xsl:text>,&#xA0;</xsl:text>

The stylesheet will now validate and can insert spaces where you'd like them to appear.

Neat.