Procedure completes prematurely after converting comma-delimited value strings to XML
It turns out that the problem was not with the procedure itself but with the PHP function calling it. Prior to execution, I had to include

        mssql_query("SET ANSI_WARNINGS ON");
        mssql_query("SET ANSI_PADDING ON");
        mssql_query("SET CONCAT_NULL_YIELDS_NULL ON");


in the function. Setting these in the procedure itself had no effect.

My question, directed at the MS SQL Server community was misguided but I'll leave this here in case anyone else has this problem.