<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
          <xsl:output method = "text" />

          <xsl:template match = "/" >
               <xsl:apply-templates select = "//comment()" />
               <xsl:text >
      #####################################
      </xsl:text>
               <xsl:apply-templates select = "//processing-instruction()" />
          </xsl:template>

          <xsl:template match = "comment()" >
               <xsl:text >
      </xsl:text>
               <xsl:value-of select = "." />
          </xsl:template>

          <xsl:template match = "processing-instruction()" >
               <xsl:text >
      </xsl:text>
               <xsl:value-of select = "concat(name(),' : ',.)" />
          </xsl:template>
     </xsl:stylesheet>
Author: Miloslav Nic [nicmila@idoox.com]