XMLリーダーに出力している文字列に少し問題があります。文字列の最初の行は空白の行であり、文字列を読み取ろうとすると、それを取り除くことができないようです。一番上の空白の行が原因で、このエラーが発生します。
Error on line 5 of document:
The processing instruction target matching "[xX][mM][lL]" is not allowed.
Nested exception:
The processing instruction target matching "[xX][mM][lL]" is not allowed."