They weren't that far away from each other. Gerrard was a better goalscorer, Xavi a better creator, and there wasn't much between them either way. So in the sense that the central or attacking mid's job is to score goals and create goals, they were on the same level in terms of position, although Xavi had better technique, while Gerrard had better athleticism.
It's a very specific skill, but Xavi was much, much better at controlling the tempo and rhythm of play. At his peak, he was a million miles from the late version of Gerrard who played at the base of midfield (but then that wasn't Gerrard at his peak - but then Gerrard never really played there during his peak...).
Gerrard would be better in almost every other way and every other position though. But if one of your midfielder needs to control the game from the base of midfield, Gerrard wouldn't get a look in for a Premier League all time XI, nevermind an all time great XI.
Now if you were looking for other midfield positions then Gerrard is a shoe in for the Premier League all time XI and definitely a contender for the all time great XI.
Ultimately, for an all time great XI, he'd be one of the best squad players you could ask for because he could cover everything from the wings to split striker to defensive mid to central mid to wing back, positions he's played for his club and country to a very high level.