Prova följande: Declare @xmldata xml set @xmldata = (select ... From test for xml...) select @xmldata as returnXml