• Note that there are a few characters that are not legal in xml.

    From http://www.w3.org/TR/2006/REC-xml-20060816/:

    [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]/* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */

    If you run:

    declare @v-2 varchar(32)

    set @v-2 = '<a>' + cast(0x08 as varchar) + '</a>'

    select cast (@v as xml)

    You will get this error:

    Msg 9420, Level 16, State 1, Line 3

    XML parsing: line 1, character 4, illegal xml character

    If your csv input list is going to have essentially ascii data this will not be a problem.

    [edit - my query was getting mangled, had to replace < with & lt;]