新建一个类 Topic 如下: [Serializable] [XmlRoot("topic")] public class Topic { /// <summary> /// 主题id /// </summary> [XmlElement("id")] public string Id { get; set; } /// <summary> /// 昵称 /// </summary> [XmlElement("nick")] public string Nick { get; set; } /// <summary> /// 标题 /// </summary> [XmlElement("title")] public string Title { get; set; } /// <summary> ///详细信息 /// </summary> [XmlElement("content")] public string Content { get; set; } /// <summary> /// 对象创建时间(格式:yyyy-MM-dd HH:mm:ss) /// </summary> [XmlElement("created")] public string Created { get; set; } /// <summary> /// 对象修改时间(格式:yyyy-MM-dd HH:mm:ss) [XmlElement("modified")] public string Modified { get; set; } } xml文件如下: <?xml version="1.0" encoding="utf-8" ?> <blog> <topic> <id><!--[CDATA[33170372]]></id> <title><![CDATA[驴友自行车商行/杭州驴友单车/自行车配件 〓皇冠信誉,值得信赖]]></title> <nick><![CDATA[驴友之家]]></nick> <content> <![CDATA[<p><font color="#ff0000" size="5"><strong>山地自行车 公路自行车 骑行服 包 骑行手套 骑行头盔 自行配件 单车精品装备<br />]]--> </content> <created>2005-06-19 08:57:06</created> <modified>2010-07-02 18:02:15</modified> </topic> </blog> 序列化类 如下: [Serializable] [XmlRoot("blog")] public class XmlParseList<T> { public List<T> List { get; set; } public static XmlParseList<T> ParseXml(string element, string body) { XmlAttributes attrs = new XmlAttributes(); attrs.XmlElements.Add(new XmlElementAttribute(element, typeof(T))); XmlAttributeOverrides attrOvrs = new XmlAttributeOverrides(); attrOvrs.Add(typeof(XmlParseList<T>), "List", attrs); XmlSerializer serializer = new XmlSerializer(typeof(XmlParseList<T>), attrOvrs); object obj = serializer.Deserialize(new StringReader(body)); return obj as XmlParseList<T>; } } 调用如下: XDocument doc = XDocument.Load("../../XMLFile1.xml"); List<Topic> list = XmlParseList<Topic>.ParseXml("topic", doc.ToString()).List;