I wouldn't mind telling you how it has to be done, if there was a way to do it. There's nothing in XML schema which specifies the order of attributes in an element. I think you should ask the person, in your project, who laid down this requirement, why he/she thinks the order of attributes is important. Maybe he/she had something else in mind? Also, just out of curiosity, how exactly do you want to order them? Alphabetically?