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