If the question is only about comparing objects, I'd go a similiar way like Olgun described. I prefer JSON over XML when it comes to identify what has been changed, because there is way less overhead in JSON structures. Also involving git is a nice benefit, especially if it's not just about comparing but building something bigger.
I built a logic on my own that recursively exports objects as JSON in a filesystem folder and then commit this to git. This allows me to do merge requests and work with multiple branches at the same time. I can exactly see the changes that have been done, even though the changes must still be interpreted.
------------------------------
☎️ Swisscom Automation/AI Engineer & 🧙 PEM Creator
Online Automic Training 24/7:
https://membership.philippelmer.com/ (deutsch)
https://pemautomic.com (english)
------------------------------