Use XML PATH like this.WITH XMLNAMESPACES (DEFAULT 'http://www.google.com')SELECT top 1'A'as [PersonalXX/Column1],'B'as [PersonalXX/Per/Column2],'C'as [PersonalXX/Column3],'D'as [Ref/Column4],'E'as [Ref/Column5],'F'as [Test/Column6],'G'as [Test/Column7],'H'as [Test/Column8]FROM [Muj_test].[dbo].[XMLNEWWorking]FOR XML PATH('SRecord'), ROOT ('SOS'), ELEMENTS XSINIL;
I assume you know that in the example you posted, you don't need the "FROM [Muj_test].[dbo].[XMLNEWWorking]".