On the 2005 homepage i needed to display rows of three divs but i felt the layout was unbalanced when the last row had only one image. To solve this i put an extra div in at the end and used mod to detect if the number of posters was divisible by 3.
"content/poster" gives us the number of poster nodes in the content node.
<xsl:if test="count(//content/poster) mod 3 = 1">
Poster Div goes here.
</xsl:if>
I used this link as a reference http://www17.homepage.villanova.edu/william.pohlhaus/xsl/mod/