How can I compare 2 XML files

you can try converting your xml to json file and use json parser to compare 2 files and internal nodes.