Maybe it\'s me, but it appears that if you have an XSD
RelaxNG will solve this problem succinctly, if you can use it. Determinism isn't a requirement for schemas. You can translate an RNG or RNC schema into XSD, but it will approximate in this case. Whether that's good enough for your use is up to you.
The RNC schema for this case is:
start = User
User = element User {
attribute ID { xsd:unsignedByte },
( element GivenName { text } &
element SurName { text } &
element * - (SurName | GivenName) { any })
}
any = element * { (attribute * { text } | text | any)* }
The any rule matches any well-formed XML fragment. So this will require the User element to contain GivenName and SurName elements containing text in any order, and allow any other elements containing pretty much anything.