xpath select referenced xml node
I need to select a node whose "name" attribute is equal to the current node's "references" attribute.

    <node name="foo" />
    <node name="bar" references="foo" />

I couldn't find a way to express this in XPATH. Any ideas. Ive tried the following:

    ./node[@name=@references]
    ./node[@name={@references}]

Obviously the above didn't work. I guess the real problem is in the brackets; how do I signify which attribute comes from which node?
xpath select referenced xml node
===

I need to select a node whose "name" attribute is equal to the current node's "references" attribute.

    <node name="foo" />
    <node name="bar" references="foo" />

I couldn't find a way to express this in XPATH. Any ideas. Ive tried the following:

    ./node[@name=@references]
    ./node[@name={@references}]

Obviously the above didn't work. I guess the real problem is in the brackets; how do I signify which attribute comes from which node?