Xavi was speaking in a press conference ahead of the El Clasico on Sunday, when Barca face La Liga leaders Real Madrid at the Santiago Bernabeu.
Messi has endured a disappointing season at Paris Saint-Germain although Barca’s dire financial situation would make re-signing the Argentinian difficult.
La Liga’s latest spending restrictions published last week set Barcelona’s limit at -144 million euros ($ 159 million). It means the club will have to make considerable savings to sign anyone in the next transfer window.
Messi was let go last year because Barca could not afford to renew his contract, bringing an emotional end to the striker’s historic career at Camp Nou.
Asked if he would open the door to Messi coming back, Xavi said: “He is the best player in history and the history of the club, he’s earned the right to have the doors open to him.
“As long as I am coach the doors are open to him if he wants to come any day. He is the best in history and as a club we owe him a great tribute, he deserves it, but he has a contract with PSG, so there is little more I can tell you.
“If he wants to come any day, to see training, talk to the coach, the doors are open because he is the best player in the history of the club.”
Without Messi, Barcelona struggled for much of the season but Xavi, who was appointed in November, has overseen a significant upturn in form.
Barca sit third, on course to qualify for next season’s Champions League, and will be hopeful of landing a statement victory against Real Madrid, who will be without their star striker Karim Benzema.
Benzema is out with a calf injury and will not be risked, allowing the Frenchman the international break to recover for the run-in and Champions League quarter-finals against Chelsea.
“Tomorrow he can’t play because he hasn’t trained,” said Carlo Ancelotti on Saturday. “He still feels a little discomfort, it’s a small injury, but it won’t let him train and obviously he won’t play either.”
“The fact that he doesn’t play tomorrow doesn’t worry me because it means we will have two weeks to get him ready for the end of the season when he will be very important as always,” Ancelotti added.
Xavi said Benzema’s absence would be a “significant blow” for Real Madrid while confirming that Gerard Pique will be available for Barca.
“He’s fine, he has some minor discomfort, but he’s fine,” said Xavi.
Despite winning their last four consecutive league games, Barcelona are 15 points behind Real Madrid in the table, albeit with a game in hand.
They could overhaul stumbling Sevilla to finish second but a late title charge appears almost impossible.
“We cannot rule Barcelona out, they will fight until the last game,” said Ancelotti.
“Winning the league is unlikely,” said Xavi. “I think will be difficult.”
But there is an opportunity for Barcelona to show they are ready to challenge for the title again under Xavi next season.
“We have grown as a team since I arrived but it doesn’t mean anything, it’s a Clasico and we have to show our personality,” Xavi said.
“It is a chance to show we are in a good moment because we have had good results but tomorrow is another litmus test, to prove that against another big team, we can play and impose our game.”
Xavi added: “Otherwise I know the media and they will say the improvement has not been seen in the most important game of the season.”