1<?xml version="1.0"?>
2
3<xsl:transform
4  version="1.0"
5  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6  xmlns:exsl="http://exslt.org/common"
7  extension-element-prefixes="exsl">
8
9  <xsl:template match="@*|node()" mode="copy">
10    <xsl:copy>
11      <xsl:apply-templates select="@*|node()" mode="copy"/>
12    </xsl:copy>
13  </xsl:template>
14
15  <xsl:template match="/">
16    <xsl:variable name="v">
17      <xsl:apply-templates mode="copy"/>
18    </xsl:variable>
19    <xsl:apply-templates select="exsl:node-set($v)" mode="copy"/>
20<!-- replacing the above line with the following one increases speed -->
21<!-- <xsl:apply-templates select="." mode="copy"/> -->
22  </xsl:template>
23
24<!-- removing the following line increases the speed -->
25  <xsl:key name="tree-by-subject_id" match="tree" use="@subject_id"/>
26
27</xsl:transform>
28
29
30
31