Sorting of XSD-based elements matching multiple correct orders

If the children of an element are out of order but multiple correct orderings exist, Gosu uses the first correct ordering defined in the schema.

Example

The following XSD defines two distinct strict orderings of the same elements:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="Element1">
    <xsd:complexType>
      <xsd:choice>
        <xsd:sequence>
          <xsd:element name="A" type="xsd:int"/>
          <xsd:element name="B" type="xsd:int"/>
          <xsd:element name="C" type="xsd:int"/>
        </xsd:sequence>
        <xsd:sequence>
          <xsd:element name="C" type="xsd:int"/>
          <xsd:element name="B" type="xsd:int"/>
          <xsd:element name="A" type="xsd:int"/>
        </xsd:sequence>
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

The following code assigns values to the child elements of the parent element:

uses examples.pl.gosu.xml.myschema.Element1

var xml = new Element1()
xml.C = 5
xml.A = 5
xml.B = 5
xml.print()

This code prints the following:

<?xml version="1.0"?>
<Element1>
  <A>5</A>
  <B>5</B>
  <C>5</C>
</Element1>