+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ version="1.0">
+ <xsl:output method="xml" encoding="UTF-8" />
+
+ <!--
+ The first rule replaces a <tspan> inside of a <text> with its
+ contents.
+ -->
+ <xsl:template match="svg:text/svg:tspan">
+ <xsl:value-of select="text()" />
+ </xsl:template>
+
+ <!--
+ Then this rule matches everything, and copies it while applying
+ any relevant templates to its children. Either we'll hit a <tspan>
+ within a <text> and process it, or we'll hit this rule again.
+ -->
+ <xsl:template match="*|@*">
+ <xsl:copy>
+ <xsl:apply-templates select="*|@*" />
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>