<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

  <xsl:preserve-space elements="*"/>

  <xsl:output method="html"/>

  <xsl:template match="/">
    <html>
      <head>
        <style type="text/css">
          .http\:\/\/www\.w3\.org\/1999\/02\/22-rdf-syntax-ns\# { color: black }
          .http\:\/\/purl\.org\/dc\/elements\/1\.1\/ {color: blue }
          .http\:\/\/purl\.org\/rss\/1\.0\/modules\/syndication\/ {color: red }
          .http\:\/\/purl\.org\/rss\/1\.0\/modules\/company\/ {color: purple }
          .http\:\/\/purl\.org\/rss\/1\.0\/modules\/textinput\/ {color: orange }
          .http\:\/\/purl\.org\/rss\/1\.0\/ { color: green } 
        </style>
      </head>
      <body bgcolor="#FFFFFF">
        <pre><xsl:apply-templates/></pre>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="*">
    <span class="{namespace-uri()}"><xsl:value-of select="concat('&lt;',name())"/></span>
    <xsl:if test="@*">
      <span class="{namespace-uri()}"><xsl:apply-templates select="@*"/></span>        
    </xsl:if>
    <span class="{namespace-uri()}">
      <xsl:choose>
        <xsl:when test="node()">
          <xsl:text>></xsl:text>
          <xsl:apply-templates select="node()"/>        
          <!-- end tag -->
          <xsl:value-of select="concat('&lt;/',name(),'&gt;')"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>/></xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </span>
  </xsl:template>

  <xsl:template match="@*">
    <xsl:value-of select="concat(' ',name(),'&quot;',.,'&quot;')"/>
  </xsl:template>

  <xsl:template match="comment()">
    <xsl:value-of select="concat('&lt;--',.,'-->')"/>
  </xsl:template>

  <xsl:template match="processing-instruction()">
    <xsl:value-of select="concat('&lt;?',.,'?>')"/>
  </xsl:template>

</xsl:stylesheet>
