Xavi risks injury to aid Barca recovery
The Spanish international scored one and had a hand in two more goals as Barca shook off the disappointment of Wednesday's Champions League semi-final exit to Inter Milan.
Xavi picked up a calf injury against Inter and had been a doubt for Saturday's game.
"He had an injury that if he aggravated it could force him to miss the World Cup," Guardiola told a news conference.
"He is committed to this club and is an example for everyone. For this reason he deserves to be recognised as the greatest midfielder in the club's history."
Spain coach Vicente del Bosque will have been relieved to hear Xavi had done no further damage to his calf with the deadline day for the naming of his squad for South Africa only three weeks away.
The 30-year-old was voted player of the tournament when Spain won Euro 2008, and he is a central figure in Del Bosque's plans.
Xavi played the ball through for Lionel Messi to score the opening goal against Villarreal, curled in a free kick for the second, and helped in the build up to Messi's second, Barca's fourth, at the end.
Only 72 hours after the demoralising end to their European Cup defence, Barca moved four points clear at the top of La Liga with three games left to play.