In my XML I have the following:
someResult
Use:
ancestor::c[1]/@something
This selects the attribute named something of the first (from the current node upwards) ancestor named c.
To move up the tree you use ".." per level ie in this instance probably
select="../../../@something"
You can also select an ancestor node by name (approx)
select="ancestor::c[1]/@something"
See http://www.stackoverflow.com/questions/3672992 for further examples