USE xmldb
GO

CREATE TABLE xml_tab(
	the_id INTEGER PRIMARY_KEY IDENTITY,
	xml_col XML)
GO

INSERT INTO xml_tab VALUES('<doc2></doc2>')
INSERT INTO xml_tab VALUES(N'<doc2></doc2>')
GO

-- both rows' values are cast to the same data type
SELECT CAST(xml_col as NCHAR(2000)) FROM xml_tab
GO

-- illegal
SELECT CAST(xml_col as SQL_VARIANT) FROM xml_tab
GO