<!-- Add sectioning around tables -->

<xsl:transform version="1.0"
	       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:output method="xml" encoding='utf-8' indent='yes'/>
  <xsl:preserve-space elements="*"/>
  
  <xsl:template match="div3[div5]">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" mode="div52div4"/>
    </xsl:copy>
  </xsl:template>
  
  <xsl:template match="div5" mode="div52div4">
    <div4>
      <xsl:apply-templates select="@*|node()" mode="div52div4"/>
    </div4>
  </xsl:template>
  
  <xsl:template match="@*|node()" mode="div52div4">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
  
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:transform>


