/foo will select based off of the root node, ignoring the context that you are evaluating the xpath against. foo (without the slash) is what you want; that selects based off of the current node.
https://www.w3schools.com/xml/xpath_syntax.asp gives a bit more info.