title: XSLT select all text and specific node
body: <p>I would like to select all text from an XHTML file except all hyperlink elements which are needed to be printed fully:</p>
  
  <p><strong>XHTML</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;html&gt;
     &lt;body&gt;
        &lt;p&gt;This is a paragraph.&lt;/p&gt;
        &lt;p&gt;This is another paragraph.&lt;/p&gt;
        &lt;a href="www.link.com"&gt;This is a link.&lt;/a&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>This is a paragraph. This is another paragraph. &lt;a href="www.link.com"&gt;This is a link.&lt;/a&gt;
  </code></pre>
  
  <p>I am using the following XSLT, but getting no results:</p>
  
  <p><strong>XSLT</strong></p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
     &lt;xsl:output method="text"/&gt;
  
     &lt;xsl:template match="@*|node()"&gt;
        &lt;xsl:apply-templates select="@*|node()"/&gt;
     &lt;/xsl:template&gt;
  
     &lt;xsl:template match="ancestor-or-self::text()"&gt;
        &lt;xsl:value-of select="text()"/&gt;
     &lt;/xsl:template&gt;
  
     &lt;xsl:template match="a"&gt;
        &lt;xsl:copy&gt;
           &lt;xsl:apply-templates select="@*|node()"/&gt;
        &lt;/xsl:copy&gt;
     &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Any help on this will be very appreciated.</p>