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 4.0.0.0 To be added System.Object XML serialization is the process of converting an object's public properties and fields to a serial format (in this case, XML) for storage or transport. Deserialization re-creates the object in its original state from the XML output. You can think of serialization as a way of saving the state of an object into a stream or buffer. For example, ASP.NET uses the class to encode XML Web service messages. The data in your objects is described using programming language constructs like classes, fields, properties, primitive types, arrays, and even embedded XML in the form of or objects. You have the option of creating your own classes, annotated with attributes, or using the XML Schema Definition Tool (Xsd.exe) to generate the classes based on an existing XML Schema definition (XSD) document. If you have an XML Schema, you can run the Xsd.exe to produce a set of classes that are strongly typed to the schema and annotated with attributes to adhere to the schema when serialized. To transfer data between objects and XML requires a mapping from the programming language constructs to XML schema and from the XML schema to the programming language constructs. The and related tools like Xsd.exe provide the bridge between these two technologies at both design time and runtime. At design time, use the Xsd.exe to produce an XML schema document (.xsd) from your custom classes or to produce classes from a given schema. In either case, the classes are annotated with custom attributes to instruct the how to map between the XML schema system and the common language runtime. At runtime, instances of the classes can be serialized into XML documents that follow the given schema. Likewise, these XML documents can be deserialized into runtime objects. Note that the XML schema is optional, and not required at design time or runtime.

Controlling Generated XML

To control the generated XML, you can apply special attributes to classes and members. For example, to specify a different XML element name, apply an to a public field or property, and set the property. For a complete list of similar attributes, see Attributes That Control XML Serialization. You can also implement the interface to control the XML output. If the XML generated must conform to section 5 of the World Wide Consortium (www.w3.org) document, "Simple Object Access Protocol (SOAP) 1.1", you must construct the with an . To further control the encoded SOAP XML, use the attributes listed in Attributes That Control Encoded SOAP Serialization. With the you can take advantage of working with strongly typed classes and still have the flexibility of XML. Using fields or properties of type , or in your strongly typed classes, you can read parts of the XML document directly into XML objects. If you work with extensible XML schemas, you can also use the and attributes to serialize and deserialize elements or attributes that are not found in the original schema. To use the objects, apply an to a field that returns an array of objects, or apply an to a field that returns an array of objects. If a property or field returns a complex object (such as an array or a class instance), the converts it to an element nested within the main XML document. For example, the first class in the following code returns an instance of the second class. Public Class MyClass Public MyObjectProperty As MyObject End Class Public Class MyObject Public ObjectName As String End Class public class MyClass { public MyObject MyObjectProperty; } public class MyObject { public string ObjectName; } The serialized, XML output looks like this: <MyClass> <MyObjectProperty> <ObjectName>My String</ObjectName> </MyObjectProperty> </MyClass> If a schema includes an element that is optional (minOccurs = '0'), or if the schema includes a default value, you have two options. One option is to use to specify the default value, as shown in the following code. Public Class PurchaseOrder <System.ComponentModel.DefaultValueAttribute ("2002")> _ Public Year As String End Class public class PurchaseOrder { [System.ComponentModel.DefaultValueAttribute ("2002")] public string Year; } Another option is to use a special pattern to create a Boolean field recognized by the , and to apply the to the field. The pattern is created in the form of . For example, if there is a field named "MyFirstName" you would also create a field named "MyFirstNameSpecified" that instructs the whether to generate the XML element named "MyFirstName". This is shown in the following example. Public Class OptionalOrder ' This field's value should not be serialized ' if it is uninitialized. Public FirstOrder As String ' Use the XmlIgnoreAttribute to ignore the ' special field named "FirstOrderSpecified". <System.Xml.Serialization.XmlIgnoreAttribute> _ Public FirstOrderSpecified As Boolean End Class public class OptionalOrder { // This field should not be serialized // if it is uninitialized. public string FirstOrder; // Use the XmlIgnoreAttribute to ignore the // special field named "FirstOrderSpecified". [System.Xml.Serialization.XmlIgnoreAttribute] public bool FirstOrderSpecified; }

Overriding Default Serialization

You can also override the serialization of any set of objects and their fields and properties by creating one of the appropriate attributes, and adding it to an instance of the class. Overriding serialization in this way has two uses: first, you can control and augment the serialization of objects found in a DLL, even if you do not have access to the source; second, you can create one set of serializable classes, but serialize the objects in multiple ways. For more details, see the class and How to: Control Serialization of Derived Classes. To serialize an object, call the method. To deserialize an object, call the method. To add XML namespaces to an XML document, see . The gives special treatment to classes that implement or . A class that implements must implement a public Add method that takes a single parameter. The Add method's parameter must be of the same type as is returned from the Current property on the value returned from GetEnumerator, or one of that type's bases. A class that implements (such as ) in addition to must have a public Item indexed property (indexer in C#) that takes an integer, and it must have a public Count property of type integer. The parameter to the Add method must be the same type as is returned from the Item property, or one of that type's bases. For classes that implement , values to be serialized are retrieved from the indexed Item property, not by calling GetEnumerator. You must have permission to write to the temporary directory (as defined by the TEMP environment variable) to deserialize an object.

Dynamically Generated Assemblies

To increase performance, the XML serialization infrastructure dynamically generates assemblies to serialize and deserialize specified types. The infrastructure finds and reuses those assemblies. This behavior occurs only when using the following constructors: If you use any of the other constructors, multiple versions of the same assembly are generated and never unloaded, which results in a memory leak and poor performance. The easiest solution is to use one of the previously mentioned two constructors. Otherwise, you must cache the assemblies in a , as shown in the following example. Hashtable serializers = new Hashtable(); // Use the constructor that takes a type and XmlRootAttribute. XmlSerializer s = new XmlSerializer(typeof(MyClass), myRoot); // Implement a method named GenerateKey that creates unique keys // for each instance of the XmlSerializer. The code should take // into account all parameters passed to the XmlSerializer // constructor. object key = GenerateKey(typeof(MyClass), myRoot); // Check the local cache for a matching serializer. XmlSerializer ser = (XmlSerializer)serializers[key]; if (ser == null) { ser = new XmlSerializer(typeof(MyClass), myRoot); // Cache the serializer. serializers[key] = ser; } else { // Use the serializer to serialize, or deserialize. } Dim serializers As New Hashtable() ' Use the constructor that takes a type and XmlRootAttribute. Dim s As New XmlSerializer(GetType([MyClass]), myRoot) ' Implement a method named GenerateKey that creates unique keys ' for each instance of the XmlSerializer. The code should take ' into account all parameters passed to the XmlSerializer ' constructor. Dim key As Object = GenerateKey(GetType([MyClass]), myRoot) ' Check the local cache for a matching serializer. Dim ser As XmlSerializer = CType(serializers(key), XmlSerializer) If ser Is Nothing Then ser = New XmlSerializer(GetType([MyClass]), myRoot) ' Cache the serializer. serializers(key) = ser Else ' Use the serializer to serialize, or deserialize. End If

Serialization of ArrayList and Generic List

The cannot serialize or deserialize the following: Arrays of Arrays of

Serialization of Enumerations of Unsigned Long

The cannot be instantiated to serialize an enumeration if the following conditions are true: The enumeration is of type unsigned long (ulong in C#) and the enumeration contains any member with a value larger than 9,223,372,036,854,775,807. For example, the following cannot be serialized. public enum LargeNumbers: ulong { a = 9223372036854775808 } // At runtime, the following code will fail. xmlSerializer mySerializer=new XmlSerializer(typeof(LargeNumbers));

Objects marked with the Obsolete Attribute no longer serialized

In the netfx35_short the  class no longer serializes objects that are marked as [Obsolete].
Serializes and deserializes objects into and from XML documents. The enables you to control how objects are encoded into XML.
Constructor 1.0.5000.0 2.0.0.0 4.0.0.0 To be added Initializes a new instance of the class. Constructor 1.0.5000.0 2.0.0.0 4.0.0.0 Commonly, an application defines several classes that the converts into a single XML-instance document. However, the must know only one type--the type of the class that represents the XML root element. The automatically serializes all subordinate class instances. Similarly, only the type of the XML root element is required for deserialization. Initializes a new instance of the class that can serialize objects of the specified type into XML documents, and deserialize XML documents into objects of the specified type. The type of the object that this can serialize. Constructor 1.0.5000.0 2.0.0.0 4.0.0.0 This constructor is used to create an when you serialize an object into a SOAP message. To control the SOAP messages generated, use the special attributes (beginning with the word "Soap") found in the namespace. Initializes an instance of the class using an object that maps one type to another. An that maps one type to another. Constructor 1.0.5000.0 2.0.0.0 4.0.0.0 To be added Initializes a new instance of the class that can serialize objects of the specified type into XML documents, and deserialize XML documents into objects of the specified type. Specifies the default namespace for all the XML elements. The type of the object that this can serialize. The default namespace to use for all the XML elements. Constructor 1.0.5000.0 2.0.0.0 4.0.0.0 By default, if a public property or field returns an object, or array of objects, the object types are automatically serialized. However, if a class contains a field or property that returns an array of type , any object can be inserted into that array. In that case, the must be instructed to expect all the possible object types that are inserted into the array. To do this, use the parameter to specify the extra object types to serialize or deserialize. You can also use the parameter to specify types derived from a base class. For example, suppose a base class named Phone exists, and a class named InternationalPhone derives from it. Use the parameter to specify the derived type as well. Initializes a new instance of the class that can serialize objects of the specified type into XML documents, and deserialize XML documents into object of a specified type. If a property or field returns an array, the parameter specifies objects that can be inserted into the array. The type of the object that this can serialize. A array of additional object types to serialize. Constructor 1.0.5000.0 2.0.0.0 4.0.0.0 The parameter can be used to control how fields and properties are encoded in XML. These settings override any attributes that already exist on the objects. This can be useful when the source code cannot be modified or multiple encodings are required for the same classes. Initializes a new instance of the class that can serialize objects of the specified type into XML documents, and deserialize XML documents into objects of the specified type. Each object to be serialized can itself contain instances of classes, which this overload can override with other classes. The type of the object to serialize. An . Constructor 1.0.5000.0 2.0.0.0 4.0.0.0 The root element of an XML document encloses all the other elements. By default, the object specified by the parameter is serialized as the root element. Properties, such as the XML element name of the root element, are taken from the object. However, the parameter allows you to replace the default object's information by specifying an ; the object allows you to set a different namespace, element name, and so on. Initializes a new instance of the class that can serialize objects of the specified type into XML documents, and deserialize an XML document into object of the specified type. It also specifies the class to use as the XML root element. The type of the object that this can serialize. An that represents the XML root element. Constructor 1.0.5000.0 2.0.0.0 4.0.0.0 The parameter allows for the creation of an that serializes a class that extends or overrides the behavior of a base class. For example, given a DLL, it is possible to create a class that inherits or extends a class contained in the DLL. To serialize such a class, you must use an instance of the class when constructing the . For more details, see . By default, if a public property or field returns an object, or array of objects, the object types are automatically serialized. However, if a class contains a field or property that returns an array of type , any object can be inserted into that array. In that case, the must be instructed to expect all the possible object types that are inserted into the array. To do this, use the parameter to specify the extra object types to serialize or deserialize. The root element of an XML document encloses all the other elements. By default, the object specified by the parameter is serialized as the root element. Properties, such as the XML element name of the root element are taken from the object. However, the parameter allows you to replace the default object's information by specifying an ; the object allows you to set a different namespace, element name, and so on. Use the parameter to specify the default namespace of all XML elements generated by the . Initializes a new instance of the class that can serialize objects of type into XML document instances, and deserialize XML document instances into objects of type . Each object to be serialized can itself contain instances of classes, which this overload overrides with other classes. This overload also specifies the default namespace for all the XML elements and the class to use as the XML root element. The type of the object that this can serialize. An that extends or overrides the behavior of the class specified in the parameter. A array of additional object types to serialize. An that defines the XML root element properties. The default namespace of all XML elements in the XML document. Constructor 2.0.0.0 4.0.0.0 Allows more precise control over access to a temporary directory and prevents code injection and exploitation. To use this method, specify a location and give access only to specific users. Administrators can set up policies with evidence lists that match evidence to permissions. Initializes a new instance of the class that can serialize objects of the specified type into XML document instances, and deserialize XML document instances into objects of the specified type. This overload allows you to supply other types that can be encountered during a serialization or deserialization operation, as well as a default namespace for all XML elements, the class to use as the XML root element, its location, and credentials required for access. The type of the object that this can serialize. An that extends or overrides the behavior of the class specified in the parameter. A array of additional object types to serialize. An that defines the XML root element properties. The default namespace of all XML elements in the XML document. The location of the types. An instance of the class that contains credentials required to access types. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Boolean To be added Gets a value that indicates whether this can deserialize a specified XML document. true if this can deserialize the object that the points to; otherwise, false. An that points to the document to deserialize. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Xml.Serialization.XmlSerializationReader To be added Returns an object used to read the XML document to be serialized. An used to read the XML document. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Xml.Serialization.XmlSerializationWriter To be added When overridden in a derived class, returns a writer used to serialize the object. An instance that implements the class. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Object Deserialization is the process of reading an XML document and constructing an object that is strongly typed to the XML Schema (XSD) of the document. Before deserializing, an must be constructed using the type of the object that is being deserialized. Use the parameter to specify an object that derives from the class, which is designed to write to streams. Classes that derive from the class include: The cannot deserialize the following: arrays of and arrays of . Deserializes the XML document contained by the specified . The being deserialized. The that contains the XML document to deserialize. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Object Deserialization is the process of reading an instance of an XML document and constructing an object that is strongly typed to the XML Schema (XSD) of the document. Before deserializing, an must be constructed using the type of the object that is being deserialized. Classes that inherit from include and . If you are using a to deserialize an object, you must construct the with an appropriate . The encoding specified by the XML document is ignored. To use the encoding specified by the XML document, use the overload that takes an instead. The automatically detects and uses the encoding specified by the XML document. The cannot deserialize the following: arrays of and arrays of . Deserializes the XML document contained by the specified . The being deserialized. The that contains the XML document to deserialize. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Object To be added Deserializes the XML document contained by the specified . The deserialized object. The that contains the XML document to deserialize. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Object Deserialization is the process of reading an instance of an XML document and constructing an object that is strongly typed to the XML Schema (XSD) of the document. Before deserializing, an must be constructed using the type of the object that is being deserialized. The automatically detects and uses the encoding specified by the XML document. The cannot deserialize the following: arrays of and arrays of . Deserializes the XML document contained by the specified . The being deserialized. The that contains the XML document to deserialize. Method 2.0.0.0 4.0.0.0 System.Object Deserialization is the process of reading an instance of an XML document and constructing an object that is strongly typed to the XML Schema (XSD) of the document. Before deserializing, an must be constructed using the type of the object that is being deserialized. Set the parameter to "http://schemas.xmlsoap.org/soap/encoding/ " for SOAP version 1.1 encoding; otherwise, set it to "http://www.w3.org/2001/12/soap-encoding" for SOAP version 1.2 encoding. Note   The cannot deserialize the following: arrays of and arrays of . Deserializes the XML document contained by the specified and encoding style. The deserialized object. The that contains the XML document to deserialize. The encoding style of the serialized XML. Method 2.0.0.0 4.0.0.0 System.Object The object being deserialized. Deserializes an XML document contained by the specified and allows the overriding of events that occur during deserialization. The being deserialized. The that contains the document to deserialize. An instance of the class. Method 2.0.0.0 4.0.0.0 System.Object This method is required for deserialization of unknown headers for Web Service scenarios only. This method allows you to avoid event synchronization in Web Service methods. Deserializes the object using the data contained by the specified . The object being deserialized. An instance of the class used to read the document. The encoding used. An instance of the class. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Xml.Serialization.XmlSerializer[] To be added Returns an array of objects created from an array of objects. An array of objects. An array of that maps one type to another. Method 2.0.0.0 4.0.0.0 System.Xml.Serialization.XmlSerializer[] To be added. Returns an instance of the class created from mappings of one XML type to another. An instance of the class. An array of objects used to map one type to another. An instance of the class that contains host and assembly data presented to the common language runtime policy system. Method 2.0.0.0 4.0.0.0 System.Xml.Serialization.XmlSerializer[] To be added. Returns an instance of the class from the specified mappings. An instance of the class. An array of objects. The of the deserialized object. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Xml.Serialization.XmlSerializer[] The method allows you to efficiently create an array of objects for processing an array of objects. Returns an array of objects created from an array of types. An array of objects. An array of objects. Method 2.0.0.0 4.0.0.0 System.Reflection.Assembly To be added. Returns an assembly that contains custom-made serializers used to serialize or deserialize the specified type or types, using the specified mappings. An object that contains serializers for the supplied types and mappings. A collection of types. A collection of objects used to convert one type to another. Method 2.0.0.0 4.0.0.0 System.Reflection.Assembly To be added. Returns an assembly that contains custom-made serializers used to serialize or deserialize the specified type or types, using the specified mappings and compiler settings and options. An that contains special versions of the . An array of type that contains objects used to serialize and deserialize data. An array of type that maps the XML data to the type data. An instance of the class that represents the parameters used to invoke a compiler. Method 2.0.0.0 4.0.0.0 System.String The XML Serializer Generator Tool (Sgen.exe) creates an XML serialization assembly for types in a specified assembly to improve the run-time performance of an when it serializes or deserializes objects of the specified types. Use the to return the name of such an assembly. If you are distributing such an assembly as part of a client application that calls a Web service, you can apply the to the client type to specify the location and name of the assembly. Returns the name of the assembly that contains one or more versions of the especially created to serialize or deserialize the specified type. The name of the assembly that contains an for the type. The you are deserializing. Method 2.0.0.0 4.0.0.0 System.String The XML Serializer Generator Tool (Sgen.exe) creates an XML serialization assembly for types in a specified assembly to improve the run-time performance of an when it serializes or deserializes objects of the specified types. Use the to return the name of such an assembly. If you are distributing such an assembly as part of a client application that calls a Web service, you can apply the to the client type to specify the location and name of the assembly. Returns the name of the assembly that contains the serializer for the specified type in the specified namespace. The name of the assembly that contains specially built serializers. The you are interested in. The namespace of the type. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Void The method converts the public fields and read/write properties of an object into XML. It does not convert methods, indexers, private fields, or read-only properties. To serialize all of an object's fields and properties, both public and private, use the . In the parameter, specify an object that derives from the abstract class. Classes that derive from include: The cannot serialize the following: arrays of and arrays of . Serializes the specified and writes the XML document to a file using the specified . The used to write the XML document. The to serialize. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Void The method converts the public fields and read/write properties of an object into XML. It does not convert methods, indexers, private fields, or read-only properties. To serialize all an object's fields and properties, both public and private, use the . In the parameter, specify an object that derives from the abstract class. Classes that derive from include: The cannot serialize the following: arrays of and arrays of . Serializes the specified and writes the XML document to a file using the specified . The used to write the XML document. The to serialize. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Void To be added Serializes the specified and writes the XML document to a file using the specified . The to serialize. The used to write the XML document. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Void The method converts the public fields and read/write properties of an object into XML. It does not convert methods, indexers, private fields, or read-only properties. To serialize all an object's fields and properties, both public and private, use the . In the parameter, specify an object that derives from the abstract class. The derives from the . The cannot serialize the following: arrays of and arrays of . Serializes the specified and writes the XML document to a file using the specified . The used to write the XML document. The to serialize. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Void When the method is invoked, the public fields and read/write properties of an object are converted into XML. Methods, indexers, private fields, and read-only properties are not serialized. To serialize all fields and properties, both public and private, use the . Use the parameter to specify an object that derives from the abstract class, which is designed to write to streams. Classes that derive from the class include: The cannot serialize the following: arrays of and arrays of . Serializes the specified and writes the XML document to a file using the specified that references the specified namespaces. The used to write the XML document. The to serialize. The referenced by the object. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Void When the method is invoked the public fields and read/write properties of an object are converted into XML. Methods, indexers, private fields, and read-only properties are not serialized. To serialize all fields and properties, both public and private, use the . Use the parameter to specify an object that derives from the abstract class. Classes that derive from class include: The cannot serialize the following: arrays of and arrays of . Serializes the specified and writes the XML document to a file using the specified and references the specified namespaces. The used to write the XML document. The to serialize. The that contains namespaces for the generated XML document. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Void When the method is invoked, the public fields and read/write properties of an object are converted into XML. Methods, indexers, private fields, and read-only properties are not serialized. To serialize all fields and properties, both public and private, use the . Use the parameter to specify an object that derives from the abstract class, which is designed to write XML documents. The derives from the . The cannot serialize the following: arrays of and arrays of . Serializes the specified and writes the XML document to a file using the specified and references the specified namespaces. The used to write the XML document. The to serialize. The referenced by the object. Method 2.0.0.0 4.0.0.0 System.Void When the method is invoked, the public fields and read/write properties of an object are converted into XML. Methods, indexers, private fields, and read-only properties are not serialized. To serialize all fields and properties, both public and private, use the . Use the parameter to specify an object that derives from the abstract class, which is designed to write XML documents. The derives from the . Set the parameter to "http://schemas.xmlsoap.org/soap/encoding/" for SOAP version 1.1 encoding; otherwise, set it to "http://www.w3.org/2001/12/soap-encoding" for SOAP version 1.2 encoding. The cannot serialize the following: arrays of and arrays of . Serializes the specified object and writes the XML document to a file using the specified and references the specified namespaces and encoding style. The used to write the XML document. The object to serialize. The referenced by the object. The encoding style of the serialized XML. Method 2.0.0.0 4.0.0.0 System.Void The id parameter supplies the base string used to create SOAP ids. By default, these are "id1", "id2" and so on. But if the parameter is set to "myBase" the generated values are "myBaseid1", "myBaseid2" and so on. This functionality is used to create unique id values across the whole SOAP message. Serializes the specified and writes the XML document to a file using the specified , XML namespaces, and encoding. The used to write the XML document. The object to serialize. An instance of the XmlSerializaerNamespaces that contains namespaces and prefixes to use. The encoding used in the document. For SOAP encoded messages, the base used to generate id attributes. Event 1.0.5000.0 2.0.0.0 4.0.0.0 System.Xml.Serialization.XmlAttributeEventHandler By default, after calling the method, the ignores XML attributes of unknown types. However, you can use this event to handle such node types. If the instance of the class being deserialized contains a field that returns an array of objects and an has been applied to the field, the event does not occur. Instead, all unknown XML attributes are collected into the array. Occurs when the encounters an XML attribute of unknown type during deserialization. Event 1.0.5000.0 2.0.0.0 4.0.0.0 System.Xml.Serialization.XmlElementEventHandler By default, after calling the method, the ignores XML attributes of unknown types. However, you can use this event to handle such node types. If the is applied to a field that returns an array of objects, all unknown elements are collected in the array. In that case, the event does not occur. Occurs when the encounters an XML element of unknown type during deserialization. Event 1.0.5000.0 2.0.0.0 4.0.0.0 System.Xml.Serialization.XmlNodeEventHandler By default, after calling the method, the ignores XML nodes of unknown types. However, you can use this event to handle such node types. Occurs when the encounters an XML node of unknown type during deserialization. Event 1.0.5000.0 2.0.0.0 4.0.0.0 System.Xml.Serialization.UnreferencedObjectEventHandler The event only occurs when the is used to deserialize an XML document that contains a SOAP message that conforms to section 5 of the World Wide Web Consortium (www.w3.org) document, "Simple Object Access Protocol (SOAP) 1.1". Documents that conform to section 5 are in a special format. At the very least, such a document includes the main body of the SOAP message. However, rather than having all types defined inline in the document, some type definitions can be encoded as references to top-level elements in the document. Thus, for every element found in the main body that is a reference, there must be a corresponding element that contains the type definition. To correlate the referencing element and the type definition, the type definition has an id attribute set to a unique string ID and the referencing element has an href attribute that references the same ID. <Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="id1" n1:GroupName=".NET" GroupNumber="ZDI=" CreationDate="2002-05-02" xmlns:n1="http:'www.cpandl.com"> <PosInt xsi:type="xsd:nonNegativeInteger">10000</PosInt> <GroupVehicle href="#id2" /> </Group> <Vehicle id="id2" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">1234</licenseNumber> </Vehicle> The event occur when there is a type definition found in the document, but no parameter in the main body references it. When the event occurs, you can retrieve the XML type of the unreferenced object by examining the property of the class. The XML ID of the object is returned by the property. The event should not be confused with the and events, which occur when there is no class member that corresponds to the XML node or element type. Occurs during deserialization of a SOAP-encoded XML stream, when the encounters a recognized type that is not used or is unreferenced.