The syntax you keep forgetting, in one place: the 13 axes, node tests, predicates, shorthand, and the function library. Every entry links to the full reference, and every example can be opened in the Sandbox and run against real XML instead of being read cold.
XPath on the Recipes sample:
//ingredient[contains(., 'pepper')]/ancestor::recipe/name
Walks up from a matching ingredient to its recipe — an axis, a predicate, and a string function in one expression.
Four abbreviations cover most day-to-day XPath: // is descendant-or-self::node()/, . is self::node(), .. is parent::node(), and @name is attribute::name. Everything else is a named axis spelled out.
Predicates filter the node set at the point where they appear, which is why (//item)[1] and //item[1] mean different things — the first takes the first item in the document, the second takes the first item under each parent.
The full reference is split by topic, with runnable examples and notes on what changed between XPath 1.0 and 3.1. If you are starting from scratch, the free courses cover XML structure first and then XPath itself.