Yes, the XML specification cares about element order. XML document type declarations (DTDs) are a part of the XML specification. They can be used to enforce a specific order of elements. The specification explicitly talks about element orders, e.g. here:
... governing the allowed types of the child elements and the order in which they are allowed to appear.
An XML document which adheres to its DTD is considered valid.
However, if you are just talking about well-formedness, but not about validity, then the order of the elements is not important.