There is no such thing as a "right" order of XML attributes. Standard XML implementations can't care about it, and they don't, and rightly so.
Human readability is about the only reason to worry about attribute order. If you want to write human-readable XML, you may need to roll your own code.