Validate XML against XSD and ignore order of child elements

I have a method in a C# app that validates a user input XML file against an embedded XSD. It works just fine, but it requires that all the child elements be in the exact order defined in the XSD. To me though, the order doesn't matter so long as the elements exist.

For example, if I had the following XSD...

<xs:element maxOccurs="unbounded" name="ParentElement">
      <xs:element name="FirstChildElement" type="xs:string" />
      <xs:element name="SecondChildElement" type="xs:string" />
      <xs:element name="ThirdChildElement" type="xs:string" />

And an XML like this...


If I validated it I'd get an error because the child elements are out of order.

Can I make some change to the XSD so validation only cares if the elements exist, and that they're under the correct parent, but not what order they're in?


Sequence means, the elements must appear in the specific order. You probably want xs:all. Take a look at

Need Your Help

grep: group capturing

regex linux bash grep

I have following string:

jQuery: Check if special characters exists in string

javascript jquery special-characters

I know this question is asked more often here on Stack, but I can't seem to get a straight answer out of the questions already posted.