I have a requirement to generate XML, validate against an XSD and (if valid), send the XML to a third party.
My problem is that generating the nodes of the XML file in the correct order (as the XSD defines it) is very difficult with my current scenario. Writing the code to manually add the nodes in the correct order would mean a lot of code as well as needing an update if the XSD changes (which it does now and then)
The XSD is fairly complex, with many element refs and groups within sequences and complexTypes.
Unfortunately, I can't attach an example since the XSD (and XML) is regarded as "company secrets".
What I would like to know is if there is a way to sort the nodes in the XML according to the definitions in the XSD?
Anyone ever heard of or seen such a function in the .Net world or otherwise? Anyone have any ideas where to start unraveling this problem?