One way using FLWOR: declare @ProductIDs xml set @ProductIDs = '<Products><names><name>Joe</name><name>usha</name><name>jack</name></names><ids><id>12</id><id>14</id></ids></Products>'select stuff(p.n.query('for $p in names/name/text() return <n>,{$p}</n>').value('.', 'varchar(50)'), 1, 1, '') [nameList], stuff(p.n.query('for $p in ids/id/text() return <n>,{$p}</n>').value('.', 'varchar(50)'), 1, 1, '') [idList]from @ProductIDs.nodes('Products')p(n) though, this schema will not help you tie the name:id relationship together. I assume you want to link the names with their respective ids? or maybe not, since you show 3 names and only 2 ids.Nathan Skerl