John Lark wrote:I need to be able to explain why its happinig.
No, you don't. The XML Recommendation (as it appears you already know) says the order of attributes is meaningless. Given that, there is no need to explain why any particular serializer outputs attributes in the order it outputs them. It suffices to say that they do what they do.