First, change this
<xsl:for-each select="//Binding">
<xsl:variable name="name"><xsl:value-of select="@Name"/></xsl:variable>
<xsl:variable name="filename"><xsl:value-of select="fn:substring(@Name,1,3)"/></xsl:variable>
<xsl:result-document href="{$filename}.xml">
<!-- I'm stuck here -->
</xsl:result-document>
</xsl:for-each>
to this:
<xsl:for-each select="Binding">
<xsl:variable name="name" select="@Name"/>
<xsl:variable name="filename" select="fn:substring(@Name,1,3)"/></xsl:variable>
<xsl:result-document href="{$filename}.xml">
<!-- I'm stuck here -->
</xsl:result-document>
</xsl:for-each>
Your code isn't wrong here, it's just that it can be improved. In particular, using xsl:value-of within xsl:variable, and unnecessary use of //, are both habits to avoid.
Now the substance. As far as I can see, within the xsl:result document you want something like:
Code:
<xsl:apply-templates select="../(Page|Paper)[@Position = xs:integer(current()/@from) to xs:integer(current()/@to)]"
and the rest should be straightforward