I need to return my result set in XML and this works fine, but if the number of records are increased, my xml output is truncated here is my query
truncated
This worked for me (SSMS 2012): Tools > Options > Query Results > SQL Server > Results to Grid: Maximum Characters Retried: XML data: Unlimited. Then I saved the results of the grid to a file.