Please consider the following:
DECLARE @xml XML
SET @xml =
'<Capture>
<Data><DataType>Card Number</DataType><Value>1234567898765</Value></Data>
<Data><DataType>Expiry Date</DataType><Value>1010</Value></Data>
</Capture>'
SELECT @xml.query('//*[text()="Expiry Date"]/text()')
Returns:
Expiry Date
Rather than retrieving the <DataType/>
text node how can I retrieve the <Value/>
text node where the text node value of <DataType/
> is "Expiry Date"?