Serialization performance and element sorting
Sorting the set of serialized objects ensures that the order of children elements of each element matches the XSD. This behavior is particularly important for sequences. For large XML objects with many nested layers, sorting requires a lot of computer resources. If you create your XML objects in the order that their sequence definitions specify, you can safely disable sorting during serialization.
The element serialization sorting property (XmlSerializationOptions.Sort)
controls whether PolicyCenter sorts the serialized XML objects.
For example, the following line of code creates an anonymous XML serialization object that performs no sorting.
myXMLElement.print(new XmlSerializationOptions() { :Sort = false } )