Let's say I have nodes like so:
<Param val="C" />
<Param val="D" />
<Param val="A" />
<Param val="B" />
If I select the Descendants of Params is the order always preserved? I want C to always be first when I iterate through the ordered list that I'll be dropping these into. Or do I need to come up with a different solution for ordering nodes? I'd like to stay away from numbers (order="1", 2 etc.) so any suggestions would be great.
The documentation for the
Descendants property says:
Returns a collection of the descendant elements for this document or element, in document order.
So the answer is yes, they will be returned in the same order they appear in the original XML.