Major changes to XML compare function
+ lots of tests for the different functionality