[Solved] XPath to select top-level elements not on the path to a given element
[ad_1] Figured it out: .//*[not(descendant::X or ancestor-or-self::X)][parent::*[descendant::X]] [ad_2] solved XPath to select top-level elements not on the path to a given element