Diff XML, via sorting XML elements and attributes

Have you ever had to diff XML files? Because ordering isn’t important in XML structure, it’s often hard to diff changes in XML, especially if changes have been generated by tooling. A colleague and I came up with a quick script in PowerShell to order all elements and attributes in an XML files for an easier diff. Continue reading