You can try something like this in 2005. First use unpivot to transorm your columns into rows, then use outer for xml query to contruct the desired schema.declare @x table (ContactId int, FirstName varchar(50), LastName varchar(50), EmailAddress varchar(50))insert into @x select 1, 'Gustavo', 'Achong', 'gustavo0@adventure-works.com' union select 2, 'Catherine', 'Abel', 'catherine0@adventure-works.com' union select 3, 'Kim', 'Abercrombie', 'kim2@adventure-works.com' select ( select name [@Name], value [*] from ( select ContactId [PK], cast(ContactID as varchar(50)) [ContactId], FirstName [FirstName], LastName [LastName], EmailAddress [EmailAddress] from @x ) d unpivot (value for name in (ContactId, FirstName, LastName, EmailAddress)) t where PK = x.ContactId for xml path('Column'), type )from @x xfor xml path('Row'), root('File'), typeNathan Skerl