Lopetegui was stunningly sacked as Spain boss a day after it was revealed he would be Zinedine Zidane's successor at Madrid.
Xavi, a 133-time Spain international, was unhappy with the timing of the announcement of Lopetegui's Madrid move.
"I am not the person to talk about it [Lopetegui joining Madrid]," the Barcelona great said. "It was not the most ideal or opportune moment."
Lopetegui's sacking came just two days before Spain's opening game against Portugal in Sochi.
Xavi believes the nation, which will be led by Fernando Hierro, can still have a strong World Cup.
"You never know, the players have already seen it all and sure, they can play a good role at the World Cup," Xavi said. "Leadership will not be missing, there is [Sergio] Ramos, [Gerard] Pique, [Andres] Iniesta.
"There are very prepared people and a very good atmosphere. It's not the best situation but at the same time, it unites them more and they give more of themselves, you never know."