How-to: Write out unmatched opening and closing tags in XSLT

Source: Reference Link

Situation...

Have you ever had to write out the start tag, do some work and then write out an end tag and been frustrated with XSLT?  It tries to "help you" by not letting you use unmatched opening and closing tags.  I know it's because XSLT is written in XML and that's an XML requirement, but the issue stands.

I spent the better part of an hour trying to arm-twist XSLT into letting me write out a potentially unbalanced set of tags. 

Another Example: Avoid an empty Unordered List

<xsl:if test="nodes.count()>0">
  <xsl:text disable-output-escaping="yes">&lt;ul&gt;</xsl:text>
</xsl:if>

call my template here to write out <li> tags with a for-each

<xsl:if test="nodes.count()>0">
  <xsl:text disable-output-escaping="yes">&lt;/ul&gt;</xsl:text>
</xsl:if>