This produces pretty verbose output, but gzipping should be able to
significantly compress it as the attributes will be repeated verbatim
every row.
<html:tr>
<for-each select="exsl:node-set($cols)/*[count(exsl:node-set($headcols)/*)>=position()]">
<html:td>
+ <attribute name="data-tsv-header">
+ <value-of select="exsl:node-set($headcols)/*[count(current()/preceding-sibling::*)+1]"/>
+ </attribute>
<value-of select="."/>
<if test="position()=count(exsl:node-set($headcols)/*)">
<for-each select="following-sibling::*">