Topic: XML parse XPath or XQuery. To pull out the data of the parent.
declare @x xml = ' <datapacket> <dids did = "1"/> <QType qtid = "1"/> <QType qtid = "2"/> </dids> <dids did = "2"/> <QType qtid = "1"/> <QType qtid = "2"/> </dids> </datapacket> ';
I want to receive as a result
c.value (N ' (@did)  ', ' smallint '); t.c.value (N ' (@qtid)  ', ' smallint ') from @x.nodes (N '/datapacket/dids/QType ') t (c)
To receive qtid and did the parent. That interests certainly not that parent - after all the enclosure can be more.
Started to look from here: https://stackoverflow.com/questions/189 -xml-value
But it was not set.