% cat toto.xml
<?xml version="1.0" encoding="utf-8"?>
<p>foo <b>bar</b> : quz</p>
% cat convert.xsl
<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE stylesheet [
<!ENTITY newln "
">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="p">
<xsl:text>&newln;</xsl:text><xsl:apply-templates/><xsl:text>&newln;</xsl:text>
</xsl:template>
<xsl:template match="b">
<xsl:text>**</xsl:text><xsl:apply-templates/><xsl:text>**</xsl:text>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
% xsltproc convert.xsl toto.xml
foo **bar** : quz
There is a non-breaking space in the source, before the colon, and it is of course outputted as-is.