It worked!
I changed the file_data task parameter to varbinary(max). And with the code below, I am able to continue my logic with the xml data saved in @xml_table.
drop table if exists #temp
create table #temp (col varchar(max) collate LATIN1_GENERAL_100_CI_AS_SC_UTF8)
insert into #temp @file_data
declare @xml_data xml = (select convert(xml, col, 2) from #temp)
declare @xml_table table (
name nvarchar(200)
, searchcode nvarchar(50)
)
insert into @xml_table (
name
, searchcode
) select
row.value('./name[1]', 'nvarchar(200)')
,row.value('./searchcode[1]', 'nvarchar(50)')
from @xml_data.nodes('/accounts/account') as c(row)
-- testing purposes only
declare @message nvarchar(max)
set @message = concat('<text>', (select top 1 name from @xml_table), '</text>')
exec tsf_send_message 'warning_msg', @message, 0
Thanks guys!