As I understand XPath, it is a way to navigate through elements in an XML document.
The direction is XPath -> element.
How do you go the other way around? That is, compute the XPath from a known element value?
For example, how would you find the xpath of the "faq" link in the stackoverflow header ?
Language is not that important, I am more interested in the algorithm and/or libraries/techniques that would help me compute the XPath.