If the XML is defined by the following:
<xs:complexType name="Whatever" ....>
<xs:element name="Tag" type="xs:string" minOccurs="0" maxOccurs="unbounded">
a document can contain:
<ns:Tag>how are you</ns:Tag>
or it could contain:
How does one write an XPath expression to find XML
Whatever elements a union of
Tag elements comparing the
text() with an
/ns:Whatever[ns:Tag/text() = ('hello','Peter','how are you')] matches both above documents. I want to only match when the text of
Tag is equal to
'how are you'.
Hopefully your .xml contains typos.
You need the or operator not the and :
<xsl:value-of select="/ns:Whatever/ns:Tag[ . = 'hello' or . = 'Peter' or . = 'how are you']"/>