xsl:for-each changes the context item. If, within the loop, you want to access the item that was the context item outside the loop, you need to bind a variable before the context item disappears:
Code:
<xsl:variable name="c" select="."/>
<xsl:for-each select="....">
<xsl:value-of select="$c/x/y/z"/>
This applies regardless whether the inner for-each selects nodes or atomic values, but in the case where it selects atomic values there is the advantage that you get an error message.