I would like to construct an XPath query that will return a \"div\" or \"table\" element, so long as it has a descendant containing the text \"abc\". The one caveat is that it
//*[self::div|self::table] [descendant::text()[contains(.,"abc")]] [not(descendant::div|descendant::table)]
The problem with contains(//text(), "abc") is that functions cast node sets taking the first node.
contains(//text(), "abc")