I’m honestly not sure if .NET’s XML interface allows this. XML doesn’t “care” about the order, so most XML libraries don’t provide a way to manipulate the order. You might consider asking in someplace like StackOverflow.com. Keep in mind that you’re really using .NET here, not PowerShell per se, and the developer-centric audience on that website would likely have a better answer for you.