Is the order that elements of a common parent appear in XML a meaningful piece of data captured by the XML document, or is order not specified as being meaningful? For examp
While XML attribute ordering is not significant as far as the XML standard is concerned, the textual representation of XML does by necessity place the attributes in a specific order. This can be an issue for things like XML Signature, which generates a digital signature for XML documents. A different attribute order would generate a different signature, which clearly is wrong.
For this (and other) reasons, there is now a standard for XML Canonicalization, which defines rules for re-organising XML documents such that they retain the same information content, but have things like whitespace, namespace declarations and attributes rearranged in a predictable way.
From xml.com
Canonical XML requires the inclusion of namespace declarations and attributes in ascending lexicographic order.