So far, we've seen how to return intrinsic types and UDTs from a WebService. The basic serialization provided by WebServices will generally suffice, but there are times when it is necessary to control the representation of elements being returned.
An XML document can have at most one root. An XML root can be defined by making use of the XMLRootAttribute. The XMLRootAttribute is used to specify the following properties in Table 4.4.1.
|DataType||XML data type of the root element|
|ElementName||The name of the root element|
|Form||Qualified or unqualified root element name|
|IsNullable||Determines if the XmlSerializer should serialize if set to null|
|Namespace||Namespace for the ...|