Result from using the tool:
It appears that xmlns attributes are sorted by alphabet, causing changes to be seen in Git.
this is difficult to fix. the original namespace ordering is not preserved when parsing the XML with JDOM2, and i'm not sure what rules are followed to build the original ordering in the AEM package.
It looks like the order of the attributes is the order of whichever one comes first in the document. (Either as an attribute namespace (i.e. jcrrimaryType - namespace 'jcr') or as a value (i.e. jcrrimaryType="nt:unstructured" - namespace 'nt')
I didn't have a lot of time, but I started digging into how the XML is being created; But didn't get very far yet.
I was indeed also thinking about a solution that would just get the original xmlns's and put them back.
One disadvantage is of course that some namespaces will still be there, even if all properties/mixins of their type are removed from the document.