ashx返回xml数据:属性值中不能使用字符“<”。该怎么处理

ashx返回xml数据:属性值中不能使用字符“<”。
返回的xml数据如下:

<?xml version="1.0" encoding="utf-8" ?> 
<root>
  <p sname="ta" rname="kike" txt="{A4FC1B23-2800-4907-B231-F026B1378D1E}.jpg" subject="语文" sid="142" rid="257" />
<p name="mike" rname="ta" txt="{A4FC1B23}.jpg" subject="语文" sid="257" rid="142" /> 
</root>

在本地内网测试都正常  放到外网就不行了
老是提示:
属性值中不能使用字符“<”。处理资源 'http://www.****.com/Log.ashx?uid=257&subject=6' 时出错。第 1 行,位置: 2281 
<p sname ="ta" rname ="mike" txt="{{06CC2E41-43FC-4ef3-AB76-182AC666098D}.jpg}" subjec...


怎么回事啊 返回时也做了编码处理啊
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
------解决方案--------------------
这个错误很明显。
XML数据里的属性包含了“<”符号。
这个错误和内外网是没有关系的。

如何检查这个错误呢?
你可以把XML保存到txt,然后根据错误提示,找到第一行第2281个字节的位置就能看到这个错误了。

为什么是第一行呢?
由于你的XML没有换行,所以全部都排列在一行里面了。