I take it you want to make the cast inside the string being built. If so, perhaps something like
select @ColumnList= @ColumnList+ ',' +
case
when data_type = 'xml' then 'cast(' + column_name + ' as varchar(max)'
else column_name
end
from information_schema.columns where
table_name = @TableName and DATA_TYPE not in ('timestamp')