USE pubs
GO

CREATE TABLE students (
 id INTEGER, 
 name VARCHAR(50), 
 major VARCHAR(20) NULL)
GO
INSERT students VALUES(1, 'Bob Smith', 'Chemistry')
INSERT students VALUES(2, 'Fred Jones', NULL)
GO

SELECT * FROM students for XML AUTO, ELEMENTS
GO

SELECT * FROM students FOR XML AUTO, ELEMENTS XSINIL
GO