Hi all,
From Page 363 of the Book "Pro T-SQL 2008 Programmer's Guide", written by Michael Coles, (published by APress), I copied the follwing code:
--Coles12_19.sql // saved in C:/Documemnts/SQL Server Management Studio -- Coles Listing 12-19 XQuery Dynamic XML Contruction -- Doing XQuery and the xml Data Type in AdvantureWorks -- 18 March 2018 1222 PM USE Testshc GO DECLARE @x xml = N'<?xml version = "1.0"?> <Geocode> <Info ID = "1"> <Coordinates Resolution = "High"> <Latitude>37.859609</Latitude> <Longitude>-122.291673</Longitude> </Coordinates> <Location Type = "Business"> <Name>APress, Inc.</Name> </Location> </Info> <Info ID = "2"> <Coordinates Resolution = "High"> <Latitude>37.4 ...

Go to the complete details ...