+<!-- $cicroot holds the root of the original document DOM tree -->
+<!-- The next two templates are trampolines to the previous two -->
+<!-- that are used to change the context node to a node in the -->
+<!-- document DOM tree of $cicroot -->
+
+<xsl:variable name="cicroot" select="/"/>
+
+<xsl:template match="node">
+ <xsl:apply-templates select="$cicroot/*[1]" mode="changecontextdocumentnode">
+ <xsl:with-param name="id" select="@id"/>
+ </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="attribute">
+ <xsl:apply-templates select="$cicroot/*[1]" mode="changecontextdocumentattribute">
+ <xsl:with-param name="id" select="@id"/>
+ <xsl:with-param name="name" select="@name"/>
+ <xsl:with-param name="child" select="@child"/>
+ <xsl:with-param name="grandchild" select="@grandchild"/>
+ </xsl:apply-templates>
+</xsl:template>
+