[xsl] gettin value of a node

Hi folks,
I have an xml like this which
<a>
<b1>
<x>1</x>
<y>hi</y>
<z>hello</z>
</b1>
<b2>
<x>1</x>
<y>hi</y>
<z>hello</z>
</b2>
<b3>
<x>2</x>
<y>u</y>
<z>king</z>
</b3>
<b4>
<x>3</x>
<y>hi</y>
<z>queen</z>
</b4>
</a>
when i transform i have to get a result like this
<group>
<b4>
<x>1</x>
<y>hi</y>
<z>hello</z>
</b4>
<b4>
<x>2</x>
<y>u</y>
<z>king</z>
</b4>
<b4>
<x>3</x>
<y>hi</y>
<z>queen</z>
</b4>
</group>
for this i used an xpath like this
<xsl:for-each select="//x[not(. = following::x)]">
<xsl:variable name="pos">
<xsl:value-of select="."/>
</xsl:variable>
which gets me all the unique x values
now when i write a statement like the below
<xsl:value-of select="//y[//x=$pos]"/>
this statement does not work for me it gives me the same value for all the
y's like it gives me
<group>
<b4>
<x>1</x>
<y>hi</y>
<z>hello</z>
</b4>
<b4>
<x>2</x>
<y>hi</y>
<z>king</z>
</b4>
<b4>
<x>3</x>
<y>hi</y>
<z>queen</z>
</b4>
</group>
can anyone tell me what is wrong please...
Thanx
Spencer
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.