I am trying to find a way to search for a string within nodes, but excluding ythe content of some subelements of those nodes. Plain and simple, I want to search for a string in
/document/p[text()[contains(., 'text')]] should do.
/document/p[text()[contains(., 'text')]]