I am facing similar problem (see error msg below). I am searching stored procedures for specific word in a SQL Server database. Pulling result sets are objectName, ObjectType and ObjectText (in which search word exist). I am trying to bring ObjectText as XML form so can be clickable to open directly from result sets. It is working fine with triggers but not with stored procedures as seems facing illegal characters while converting into XML form.
I have tried couple of suggestions provided on net such as cast/convert/replace unified characters, XML, ascii etc and replace illegal characters like 
, 
, 	 but no success.
SELECT
o.name as 'ObjectName',
CASE o.xtype
WHEN 'C' THEN 'CHECK constraint '
WHEN 'D' THEN 'Default or DEFAULT constraint'
WHEN 'F' THEN 'FOREIGN KEY constraint'
WHEN 'FN' THEN 'Scalar function'
WHEN 'IF' THEN 'In-lined table-function'
WHEN 'K' THEN 'PRIMARY KEY or UNIQUE constraint'
WHEN 'L' THEN 'Log'
WHEN 'P' THEN 'Stored procedure'
WHEN 'R' THEN 'Rule'
WHEN 'RF' THEN 'Replication filter stored procedure'
WHEN 'S' THEN 'System table'
WHEN 'TF' THEN 'Table function'
WHEN 'TR' THEN 'Trigger'
WHEN 'U' THEN 'User table'
WHEN 'V' THEN 'View'
WHEN 'X' THEN 'Extended stored procedure'
ELSE o.xtype
END as 'ObjectType',
CAST(c.text as XML) as 'SearchObject'
FROM
syscomments c
INNER JOIN
sysobjects o ON c.id = o.id
LEFT JOIN
sysobjects p ON o.Parent_obj = p.id
WHERE
o.xtype = 'P'
AND (c.text LIKE '%loan_timestamp%' OR
c.text LIKE '%aclk_timestamp%' OR
c.text LIKE '%addr_timestamp%')
Error:
Msg 9455, Level 16, State 1, Line 121
XML parsing: line 44, character 28, illegal qualified name character
CAST(c.text as XML) AS 'SearchObject'
This column should result be in clickable XML so stored procedures / triggers can be opened directly from result sets.