The approach I would take is to match items in the 1st, 4th, 7th positions by using the 'mod' function of the position() on each item.
After matching each such item, just loop through the following siblings based on the column count.
For the last row, where there may be insufficient items to complete the row, there is a recursive template to add in empty cells based on how many items were in the last row.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Global variable to get column count -->
<xsl:variable name="columns" select="number(/list/@columns)"/>
<!-- Match the root node -->
<xsl:template match="list">
<table>
<!-- Match items in the 1st, 4th, 7th positions, etc (or whatever the column variable holds) -->
<xsl:apply-templates select="item[position() mod $columns = 1]"/>
</table>
</xsl:template>
<xsl:template match="item">
<tr>
<!-- Output the current item -->
<td>
<xsl:value-of select="."/>
</td>
<!-- Output the following items based on the number of required columns -->
<xsl:for-each select="following-sibling::item[position() < $columns]">
<td>
<xsl:value-of select="."/>
</td>
</xsl:for-each>
<!-- Add in any empty cells if numberof following items is not sufficient -->
<xsl:call-template name="emptycell">
<xsl:with-param name="cellcounter" select="count(following-sibling::item[position() < $columns]) + 1" />
</xsl:call-template>
</tr>
</xsl:template>
<!-- Recursive template to add in empty cells when there are not enough items to complete a row -->
<xsl:template name="emptycell">
<xsl:param name="cellcounter" />
<xsl:if test="$cellcounter < $columns">
<td></td>
<xsl:call-template name="emptycell">
<xsl:with-param name="cellcounter" select="$cellcounter + 1" />
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>