If the order is important then you should be using elements not attributes. The XML recommendation says that attribute order is "not significant" (see section 3.1).
Note that the order of attribute specifications in a start-tag or empty-element tag is not significant.
Elements, on the other hand, do have a specified ordinal position within their parent.
But if I had to guess at a work around, I would say removing all attributes and then readding them in the order you want might work. But then again they may be emitted in alphabetical order as well, or even some other seemingly arbitrary order; it's behavior is non deterministic at best, and could change in future implementations of the API.
Even if you could do it in ActionScript, running it through any other XML tool, like an XSLT, then there is no guarantee that they will respect attribute order.
The right answer is "don't do that."
Also see this question for a similar point of reference.
To borrow from that answer, if you are dealing with a document where attribute order is relevant, then you aren't using XML -- just something that superficially looks like XML. Therefore, you should probably not be using XML based tools/libraries to process or generate that document.