Find position of a node using XPath June 9, 2022 by Tarik Try: count(a/b[.='tsr']/preceding-sibling::*)+1.