我在数据库中有XML保存,XML包含特殊字符,如&
,在将对象转换为XML时,将&
转换为&
。我希望从XML &
返回&
。请帮忙。
private static XmlDocument DeserializeToXmlDocument(String xml)
{
XmlSerializer xs = new XmlSerializer(typeof(XmlDocument));
StringReader stringReader = new StringReader(xml);
XmlDocument doc = (XmlDocument)xs.Deserialize(stringReader);
stringReader.Close();
return doc;
}