This is the code that I currently have:
-
-
-
-
-
<
Adding to the answer above, both the expressions below will work well.
//span[contains(text(), 'ABZ')]/following::section/span[@name='edit']
OR
//span[contains(text(), 'ABZ')]/../following-sibling::section/span[@name='edit']
Notably, the axis following will pick each node following the context node while the axis following-sibling will only pick the sibling nodes to the context node.