Xavi can not compare to Ten Hag who has a longer career than Xavi. Ten Hag not only has a longer career but also more successful one. He succeeded in Netherlands with Ajax Amstersdam in Eredivisie league and in Champions League with a generation of De Ligt, De Jong, Ziyech. Xavi only has one title with Barcelona recent days in Spanish Super Cub. He failed with Barcelona in Champions League this season and comparing their records, Xavi has a less impressive record than Ten Hag.
When comparing the two coaches, the name Erik ten hag is still above Xavi when it comes to his contribution to the club. Erik ten hag was successful with Ajax, that's why the red devils brought him to Old Trafford to train Manchester United now, while Xavi might have helped him with his contribution as a Barcelona legend which allowed him to now train Barcelona's main club. It will take time for Xavi to be compared to a coach as great as Erik ten Hag and I think Xavi can achieve that in a few seasons.
I do not think that the difference is that big at the current moment. United is doing well and Erik Tan Hag is a manager that went head to head against Ronaldo and won, that brought in a lot of respect out of me. Normally most managers crumble against superstars like him, and they would let him do whatever they want so that manager doesn't get in trouble. But, he fought and he won and he brought the team to a high place.
But Xavi is managing Barcelona right now, and they are leading the league currently as well, which is a big achievement, to come back from a terrible season where the manager was sacked, into a season where you may beat Real? That's very good too.