If you have a variable but not-too-large number, you can use simple recursion
<xsl:template name="doelements">
<xsl:param name="howmany" select="0"/>
<xsl:if test="$howmany > 0">
<element1/>
<xsl:call-template name="doelements">
<xsl:with-param name="howmany">
<xsl:value-of select="$howmany - 1"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
so where you want 5 of them you would call
<xsl:call-template name="doelements">
<xsl:with-param name="howmany">
<xsl:value-of select="5"/>
</xsl:with-param>
</xsl:call-template>
(didn't check, might be off-by-one, left as an excercise to the reader ;-)