I am trying to export some data in xml format from filemaker using XSLT. I want to display the same data in three places on the xml. I was displaying the data once by using for-each tag. Some how a variable can be used here but I dont know how.

<xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">

<xsl:for-each select="fmp:COL[3]/fmpATA">
<xsl:value-of select="."/>
<xsl:variable name="pos" select="position()" />
<xsl:value-of select="../../fmp:COL[6]/fmpATA[$pos]"/>
<xsl:value-of select="../../fmp:COL[4]/fmpATA[$pos]"/>
<xsl:value-of select="../../fmp:COL[5]/fmpATA[$pos]"/>

But when I want to export the above data in three different places in the same XML, It fails. I'm not an XSLT person so my apologise in the begining if I'm not clear. Thanks very much