See here for examples. You write the qureies like in the example below taken from that page:
WITH XMLNAMESPACES ('uri1' as ns1,
'uri2' as ns2,
DEFAULT 'uri2')
SELECT ProductID,
Name,
Color
FROM Production.Product
WHERE ProductID=316 or ProductID=317
FOR XML RAW ('ns1:Product'), ROOT('ns2:root'), ELEMENTS
You can designate one namespace as the default as in the example. For elements in that namespace, you don't have to prefix the namespace alias when referring to them. For all other namespaces you should refer to them prefixed with the namespace alias and a colon.