title: XSL character escape problem
body: <p>I am writing this because I have really hit the wall and cannot go ahead. In my database I have escaped HTML like this: <code>"&amp;lt;p&amp;gt;My name is Freddy and I was"</code>.</p>
  
  <p>I want to show it as HTML OR strip the HTML tags in my XSL template. Both solutions will work for me and I will choose the quicker solution.</p>
  
  <p>I have read several posts online but cannot find a solution. I have also tried disable-output-escape with no success. Basically it seems the problem is that somewhere in the XSL execution the engine is changing this <code>&amp;lt;p&amp;gt;</code> into this: <code>&amp;amp;lt;p&amp;amp;gt;</code>.</p>
  
  <p>It is converting the <code>&amp;</code> into <code>&amp;amp;</code>. If it helps, here is my XSL code. I have tried several combinations with and without the output tag on the top.</p>
  
  <p>Any help will be appreciated. Thanks in advance.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
    &lt;xsl:output method="html" omit-xml-declaration="yes"/&gt;
  
    &lt;xsl:template match="DocumentElement"&gt;
      &lt;div&gt;
        &lt;xsl:attribute name="id"&gt;mySlides&lt;/xsl:attribute&gt;
        &lt;xsl:apply-templates&gt;
          &lt;xsl:with-param name="templatenumber" select="0"/&gt;
        &lt;/xsl:apply-templates&gt;
      &lt;/div&gt;
  
      &lt;div&gt;
        &lt;xsl:attribute name="id"&gt;myController&lt;/xsl:attribute&gt;
        &lt;xsl:apply-templates&gt;
          &lt;xsl:with-param name="templatenumber" select="1"/&gt;
        &lt;/xsl:apply-templates&gt;
      &lt;/div&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template match="DocumentElement/QueryResults"&gt;
      &lt;xsl:param name="templatenumber"&gt;tobereplace&lt;/xsl:param&gt;
  
      &lt;xsl:if test="$templatenumber=0"&gt;
        &lt;div&gt;
          &lt;xsl:attribute name="id"&gt;myController&lt;/xsl:attribute&gt;
          &lt;div&gt;
            &lt;xsl:attribute name="class"&gt;article&lt;/xsl:attribute&gt;
            &lt;h2&gt;
              &lt;a&gt;
                &lt;xsl:attribute name="class"&gt;title&lt;/xsl:attribute&gt;
                &lt;xsl:attribute name="title"&gt;&lt;xsl:value-of select="Title"/&gt;&lt;/xsl:attribute&gt;
                &lt;xsl:attribute name="href"&gt;/stories/stories-details/articletype/articleview/articleid/&lt;xsl:value-of select="ArticleId"/&gt;/&lt;xsl:value-of select="SEOTitle"/&gt;.aspx&lt;/xsl:attribute&gt;
                &lt;xsl:value-of select="Title"/&gt;
              &lt;/a&gt;
            &lt;/h2&gt;
            &lt;div&gt;
              &lt;xsl:attribute name="style"&gt;text-indent: 25px;&lt;/xsl:attribute&gt;
              &lt;xsl:attribute name="class"&gt;articlesummary&lt;/xsl:attribute&gt;
              &lt;xsl:call-template name="removeHtmlTags"&gt;
                &lt;xsl:with-param name="html" select="Summary" /&gt;
              &lt;/xsl:call-template&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/xsl:if&gt;
      &lt;xsl:if test="$templatenumber=1"&gt;
        &lt;div&gt;
          &lt;xsl:attribute name="id"&gt;myController&lt;/xsl:attribute&gt;
          &lt;span&gt;
            &lt;xsl:attribute name="class"&gt;jFlowControl&lt;/xsl:attribute&gt;
            aa
          &lt;/span&gt;
        &lt;/div&gt;
      &lt;/xsl:if&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template name="removeHtmlTags"&gt;
      &lt;xsl:param name="html"/&gt;
      &lt;xsl:choose&gt;
        &lt;xsl:when test="contains($html, '&amp;lt;')"&gt;
          &lt;xsl:value-of select="substring-before($html, '&amp;lt;')"/&gt;
          &lt;!-- Recurse through HTML --&gt;
          &lt;xsl:call-template name="removeHtmlTags"&gt;
            &lt;xsl:with-param name="html" select="substring-after($html, '&amp;gt;')"/&gt;
          &lt;/xsl:call-template&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:otherwise&gt;
          &lt;xsl:value-of select="$html"/&gt;
        &lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
    &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>