<?xml version="1.0"?>
<!-- xmltree.xsl: pretty print arbitrary xml. 
     Version 1.0
     GPL Licenced
     ekoontz@hiro-tan.org -->
<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns="http://www.w3.org/1999/xhtml" 
  version="1.0">
  <xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="yes"/>

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

  <xsl:template match="/">
    <html>
      <head></head>
      <body>
        <div style="font-family:courier">
          <pre>
            <xsl:apply-templates select="." mode="pretty"/>
          </pre>
        </div>
        <div>generated by xmltree.xsl version 1.0 &lt;ekoontz@hiro-tan.org&gt;</div>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="*" mode="pretty">
    <xsl:param name="depth" select="'0'"/>
    <xsl:call-template name="indent"><xsl:with-param name="depth" select="$depth"/></xsl:call-template>&lt;<xsl:value-of select="name()"/><xsl:apply-templates select="@*" mode="pretty"/>&gt;<xsl:apply-templates mode="pretty"><xsl:with-param name="depth" select="1 + $depth"/></xsl:apply-templates>
    <xsl:text> </xsl:text>
    <xsl:call-template name="indent"><xsl:with-param name="depth" select="$depth + 1"/></xsl:call-template>&lt;/<xsl:value-of select="name()"/>&gt;<xsl:text></xsl:text></xsl:template>

  <xsl:template match="@*" mode="pretty"><xsl:text> </xsl:text><xsl:value-of select="name()"/>=&quot;<xsl:value-of select="."/>&quot; </xsl:template>


  <xsl:template name="indent">
    <xsl:param name="depth" select="'0'"/>
    <xsl:if test="$depth &gt; 0">
      <xsl:text>   </xsl:text>
      <xsl:call-template name="indent">
        <xsl:with-param name="depth" select="$depth - 1"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>


</xsl:stylesheet>