I want all nodes of an xml document that are not descendants of nodes X.
(My actual problem is a little more complex, but I\'m stuck with the \"are not descendants\" par
If you translate "are not descendants" to "have no ancestor", you get the expression //*[not(ancestor::X)]. This will return all nodes in a document, which are not descendants of nodes named "X".
//*[not(ancestor::X)]