System.Xml [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 To be added System.Object Class for serializing and and deserializing objects to XML.

XML serialization is useful when we want to store object state and restore it back later.

XML serialization main benefits are:
It is easy to use
It is very fast
You have to write mimimum of code
On the other hand:
All properties or fields you want to serialize must be public
Not every object can be serialized
Your classes must be designed for serialization (e.g you must provide public paremeterless constructor.)

Now take a look at simple XML serialization example:

`// Simple XML serialization using System; using System.IO; using System.Xml.Serialization; public class MyObject { public int X; public int Y; public MyObject() { } public MyObject(int x, int y) { this.X = x; this.Y = y; } public static void Main(string[] args) { MyObject o = new MyObject (5, 8); using (FileStream fs = new FileStream("test.xml", FileMode.Create)) { XmlSerializer serializer = new XmlSerializer(typeof(MyObject)); serializer.Serialize(fs, o); } } }`

MyObject is here class that will be serialized. We serialize it's instance o to file test.xml. First we must create instance of XmlSerializer. As parameter we pass type of object we want to serialize. Then calling Serialize method with stream and object does serialization for us.

Next example shows how to load object back from XML.

`// Simple XML deserialization using System; using System.IO; using System.Xml.Serialization; public class MyObject { public int X; public int Y; public MyObject() { } public MyObject(int x, int y) { this.X = x; this.Y = y; } public static void Main(string[] args) { MyObject o; using (FileStream fs = File.OpenRead("test.xml")) { XmlSerializer serializer = new XmlSerializer(typeof(MyObject)); o = (MyObject) serializer.Deserialize(fs); } Console.WriteLine("Deserialized object: " + o.X + "," + o.Y); } }`

These were two simple examples, but reality is more complex. You will need to control serialization process. That can be done using various attributes from System.Xml.Serialization. Use

XmlIgnore attribute for public fields or properties that you don't want to serialize
- Constructor
  To be added
  To be added
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added: an object of type 'System.Type'
  To be added
  To be added
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added: an object of type 'XmlTypeMapping'
  To be added
  To be added
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added: an object of type 'System.Type'
  To be added: an object of type 'string'
  To be added
  To be added
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added: an object of type 'System.Type'
  To be added: an object of type 'System.Type[]'
  To be added
  To be added
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added: an object of type 'System.Type'
  To be added: an object of type 'XmlAttributeOverrides'
  To be added
  To be added
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added: an object of type 'System.Type'
  To be added: an object of type 'XmlRootAttribute'
  To be added
  To be added
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added: an object of type 'System.Type'
  To be added: an object of type 'XmlAttributeOverrides'
  To be added: an object of type 'System.Type[]'
  To be added: an object of type 'XmlRootAttribute'
  To be added: an object of type 'string'
  To be added
  To be added
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  2.0.0.0
- Method
  System.Boolean `` To be added: an object of type 'System.Xml.XmlReader' To be added To be added: an object of type 'bool' To be added 1.0.5000.0 2.0.0.0
- Method
  System.Xml.Serialization.XmlSerializationReader To be added To be added: an object of type 'XmlSerializationReader' To be added 1.0.5000.0 2.0.0.0
- Method
  System.Xml.Serialization.XmlSerializationWriter To be added To be added: an object of type 'XmlSerializationWriter' To be added 1.0.5000.0 2.0.0.0
- Method
  System.Object `` To be added: an object of type 'System.IO.Stream' To be added To be added: an object of type 'object' To be added 1.0.5000.0 2.0.0.0
- Method
  System.Object `` To be added: an object of type 'System.IO.TextReader' To be added To be added: an object of type 'object' To be added 1.0.5000.0 2.0.0.0
- Method
  System.Object `` To be added: an object of type 'XmlSerializationReader' To be added To be added: an object of type 'object' To be added 1.0.5000.0 2.0.0.0
- Method
  System.Object `` To be added: an object of type 'System.Xml.XmlReader' To be added To be added: an object of type 'object' To be added 1.0.5000.0 2.0.0.0
- Method
  System.Object `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Object `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Object `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Xml.Serialization.XmlSerializer[] `` To be added: an object of type 'XmlMapping[]' To be added To be added: an object of type 'XmlSerializer[]' To be added 1.0.5000.0 2.0.0.0
- Method
  System.Xml.Serialization.XmlSerializer[] `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Xml.Serialization.XmlSerializer[] `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Xml.Serialization.XmlSerializer[] `` To be added. To be added To be added: an object of type 'XmlSerializer[]' To be added 1.0.5000.0 2.0.0.0
- Method
  System.Reflection.Assembly `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Reflection.Assembly `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.String `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.String `` `` To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` To be added: an object of type 'System.IO.Stream' To be added: an object of type 'object' To be added To be added 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` To be added: an object of type 'System.IO.TextWriter' To be added: an object of type 'object' To be added To be added 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` To be added: an object of type 'object' To be added: an object of type 'XmlSerializationWriter' To be added To be added 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` To be added: an object of type 'System.Xml.XmlWriter' To be added: an object of type 'object' To be added To be added 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` `` To be added: an object of type 'System.IO.Stream' To be added: an object of type 'object' To be added: an object of type 'XmlSerializerNamespaces' To be added To be added 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` `` To be added: an object of type 'System.IO.TextWriter' To be added: an object of type 'object' To be added: an object of type 'XmlSerializerNamespaces' To be added To be added 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` `` To be added. To be added: an object of type 'object' To be added: an object of type 'XmlSerializerNamespaces' To be added To be added 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void `` `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0
- Event
  System.Xml.Serialization.XmlAttributeEventHandler To be added To be added 1.0.5000.0 2.0.0.0
- Event
  System.Xml.Serialization.XmlElementEventHandler To be added To be added 1.0.5000.0 2.0.0.0
- Event
  System.Xml.Serialization.XmlNodeEventHandler To be added To be added 1.0.5000.0 2.0.0.0
- Event
  System.Xml.Serialization.UnreferencedObjectEventHandler To be added To be added 1.0.5000.0 2.0.0.0