I believe the best approach is to use a variable and a named template. With named templates you can pass in parameters. Here is my suggestions. Keep in mind I do not have an xml input and this is untested, but the approach can be easy to duplicate in your real code:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:layout-master-set>
<fo:simple-page-master master-name="repeating" page-height="28cm" page-width="22cm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="0cm">
<xsl:variable name="size">
<xsl:call-template name="reg-sizes">
<xsl:with-param name="headrows">10</xsl:with-param>
<xsl:with-param name="lineheight">35</xsl:with-param>
<xsl:with-param name="lineheightminmax">2</xsl:with-param>
<xsl:with-param name="uom">px</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="varLineHeight_DEFAULT_PDF" select="string('2')"></xsl:variable>
<xsl:variable name="varHeadingLineHeight_DEFAULT_PDF" select="string('2')"></xsl:variable>
<xsl:variable name="varUnitOfMeasure_DEFAULT_PDF" select="string('2')"></xsl:variable>
<fo:region-body>
<xsl:attribute name="margin-top">
<xsl:value-of select="$size"/>
</xsl:attribute>
<xsl:attribute name="margin-bottom">
<xsl:value-of select="format-number(count(EOB/TRAILER/TRAILERLINE[.!=''])*$varLineHeight_DEFAULT_PDF+$varHeadingLineHeight_DEFAULT_PDF,'#.00')"/>
<xsl:value-of select="$varUnitOfMeasure_DEFAULT_PDF"/>
</xsl:attribute>
</fo:region-body>
<fo:region-before>
<xsl:attribute name="extent">
<xsl:value-of select="$size"/>
</xsl:attribute>
</fo:region-before>
</fo:simple-page-master>
</fo:layout-master-set>
</xsl:template>
<xsl:template name="reg-sizes">
<xsl:param name="headrows"/>
<xsl:param name="lineheight"/>
<xsl:param name="lineheightminmax"/>
<xsl:param name="uom"/>
<xsl:choose>
<xsl:when test="(EOB/PKCREVIEWONLYFLAG[.='D'] or EOB/PKCREVIEWONLYFLAG[.='R']) and EOB/PAYKINDCODEDESC[.!='']">
<xsl:value-of select="format-number($lineheightminmax+(($headrows + .3)*$lineheight)+.1,'#.00')"/>
<xsl:value-of select="$uom"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number($lineheightminmax+($headrows*$lineheight)+.1,'#.00')"/>
<xsl:value-of select="$uom"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>