+<!-- ========= -->
+<!-- = utils = -->
+<!-- ========= -->
+<xsl:template name="section-anchor">
+ <!--
+ this formula works as follows:
+ - get all ancestors including self
+ - choose the header (third one from root): utwor/book-type/header
+ - get all preceding siblings
+ - count them
+ - create an <a name="sec123"/> tag.
+ -->
+ <a name="{concat('sec', count(ancestor-or-self::*[last()-2]/preceding-sibling::*) + 1)}" />
+</xsl:template>