Talking about Modric and Xavi
Someone said Xavi needed a system(tiki-taka) to support his talent or someone says he was a one dimensional player. I would say yes and he needed some excellent players who really had great football iq and really knew about movements and intelligence of the game. However, when he had all of those components that can maximize his strengths or team built around him and used him in a proper way. The result was he was the most dominant central midfielder that I've ever seen in my life, when platform was perfect to him he could control the game and possession like no one else have ever done before. Not only Xavi played well the rest of them were elevated by Xavi's performances and skills. Barcelona and Spain during 2008-2012 represented my words.
Modric, Luka is a different breed for me, he has some similar traits to Xavi. On the other hand, he has some different traits too. Some specialist skills Xavi was better and some Modric is better.
Modric is better than Xavi in term of adaptable in any tactics and manager. You could put him easily on an offensive minded team and he will show his abilities, on the other hand, you could put him on defensive minded team and he will probably play well too. He could adapt to manager that has offensive-minded or defensive minded depends on what do you want. Both have similar one thing that both play best in 4-3-3 system, although Modric played well in 4-2-3-1 during world cup 2018 or a lot of matches with 4-4-2 in Spurs, on Xavi side, he played well during Euro 2008 in 4-4-2 or 3-4-3 during Guardiola's system. Modric probably has a better longevity at highest level than Xavi too and he probably has a bit better complete skillsets than Xavi too. However, when both have the best systems that could support both to highest levels performances as could as they can, I choose Xavi as a better person in this department. He was a more dominant player that could control the game in his hand. In term of peak, I think it's not far, it's probably close called but if I choose I still choose peak Xavi over peak Modric although Modric got a Ballon d'Or 2018 . In term of their skillsets , Modric is more complete skillsets than Xavi but Xavi despite being less complete he still had better skillsets than Modric, despite being less complete.
I would say that both play in the right teams, systems and time. Xavi was probably a better fit for Guardiola's Barcelona for sure and Modric for me is a better fit for Madrid's system for sure. Madrid's system is different from Barcelona as they have played more counter-attacking football, more direct, more transition game by using wingers on both side to do a great counter-attack ( Anchelloti and Zidane like this way of playing when they faced big-teams in Uefa Champions League), lower defensive line and less depending on system and focus
more on adaptable on opponents ( Zidane's is great in this department) and Modric is more appropriate player for Madrid and their different styles of playing from both teams have represent their different characteristics and characters between Xavi and Modirc too.
For me, I would choose Xavi as a better player and career than Modric. Although, it's not that far probably very close. I feel like he was a more dominant player on the pitch and could control the game in his own hand like no other central midfielders have done before. On compare Xavi with Matthaus or Rijkaard are different stories and circumstances and if we want to compare, it will be in another way of comparing.
The last one about Modric vs Xavi is peak Xavi is more consistent in league system than peak Modric too. That's similar to their team characteristics that Xavi's Barcelona was more consistent and better in league system due to their solid systems but Modric's Madrid is better adaptable team and has performed very solid in Champions League (2014-present).