I can\'t figure out how to search for text containing single quotes using XPATHs.
For example, I\'ve added a quote to the title of this question. The following line<
This is an example:
/*/*[contains(., "'") and contains(., '"') ]/text()
When this XPath expression is applied on the following XML document:
I'm reading "Harry Potter"
I am reading "Harry Potter"
I am reading 'Harry Potter'
the wanted, correct result (a single text node) is selected:
I'm reading "Harry Potter"
Here is verification using the XPath Visualizer (A free and open source tool I created 12 years ago, that has taught XPath the fun way to thousands of people):

Your problem may be that you are not able to specify this XPath expression as string in the programming language that you are using -- this isn't an XPath problem but a problem in your knowledge of your programming language.