仅供参考:
auther:king
using System;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
/// <summary>
/// ObjectToXml
/// </summary>
public class ObjectToXml
{
/// <summary>
/// Serialize Current Object To Xml Format
/// </summary>
/// <returns>Input: Xml Format String</returns>
public string SerializeToXml()
{
StringBuilder strBuilder = new StringBuilder();
try
{
XmlSerializer serializer = new XmlSerializer(this.GetType());
TextWriter writer = new StringWriter(strBuilder);
serializer.Serialize(writer, this);
}catch(Exception e)
{