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

  <xsl:template match="/">
    <svg viewBox="-100 -100 200 200">
      <defs>
        <linearGradient id="gradient" gradientUnits="userSpaceOnUse"
          x1="-100" y1="-100" x2="100" y2="100">
          <stop offset="0" stop-color="#f44"/>
          <stop offset="1" stop-color="#44f"/>
        </linearGradient>
      </defs>

      <xsl:call-template name="draw-primitive">
        <xsl:with-param name="depth" select="8"/>
      </xsl:call-template>
    </svg>
  </xsl:template>

  <xsl:template name="draw-primitive">
    <xsl:param name="depth" select="0"/>
    <xsl:if test="$depth > 0">
      <rect x="-100" y="-100" width="200" height="200" fill="url(#gradient)"/>
      <g transform="scale(.5,.5)">
        <g transform="translate(0,-100) rotate(-5)">
          <xsl:call-template name="draw-primitive">
            <xsl:with-param name="depth" select="$depth - 1"/>
          </xsl:call-template>            
        </g>
        
        <g transform="translate(-100,100) rotate(-5)">
          <xsl:call-template name="draw-primitive">
            <xsl:with-param name="depth" select="$depth - 1"/>
          </xsl:call-template>            
        </g>
        
        <g transform="translate(100,100) rotate(-5)">
          <xsl:call-template name="draw-primitive">
            <xsl:with-param name="depth" select="$depth - 1"/>
          </xsl:call-template>            
        </g>
      </g>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>
