Hi Stefan,
Sorry, still does not work in some simple cases, for example the XSLT code only matches DITA topics and not tasks, concepts and so on. So the template matching should be DITA specialization aware.
Looking at the code in the reveal.xsl, it seems that what should be done is to obtain from an XML containing a nested set of topics a flat list of HTML section elements.
In my opinion the template which matches "//topic" should be rewritten to do something like:
<xsl:template match="*[contains(@class, ' topic/topic ')]">
<section>
<xsl:apply-templates select="node()[not(contains(@class,' topic/topic '))]"/>
</section>
<xsl:apply-templates select="*[contains(@class, ' topic/topic ')]"/>
</xsl:template>