+<!--
+ Delete style elements, as they will get hoisted occur under <head> below.
+ If the generate-listing attribute was specified, produce a code listing
+ where the style attribute was found.
+-->
+<xsl:template match='xhtml:style|@generate-listing[parent::xhtml:style]' />
+<xsl:template match='xhtml:style[@generate-listing]'>
+ <pre>⁠<code><xsl:value-of select='f:strip-leading(.)' /></code></pre>
+</xsl:template>
+
+<!--
+ Add a simple way to reference a document node by ID and include the XHTML
+ code listing directly in the document.
+-->
+<xsl:template match='xhtml:generate-xhtml-listing'>
+ <xsl:variable name='target' select='@target' />
+ <pre>⁠<code>
+ <xsl:value-of select='f:xhtml-listing(//xhtml:*[@id=$target])' />
+ </code></pre>
+</xsl:template>
+