If you can remember the syntax you are better than me, but here is an example I crafted for querying XML in SQL Server:
SELECT
T.X.query('declare namespace N="http://helpmenow";//N:me[@now="false"]').value('.', 'NVARCHAR(MAX)')
FROM
(
SELECT
CONVERT(XML, '<help xmlns="http://helpmenow"><me now="true">yay</me><me now="false">too bad</me></help>') X
) T
Of course the result will be “too bad”.
Once you have the value of a field like that it is a normal string, so could be used in a where criteria etc.
See also MSDN – XML Support in Microsoft SQL Server 2005
Pingback: SQL Server: Updating XML fields – XPath, XQuery – #sql #sqlserver #xml #xpath #xquery | Tim's cycling blog