Xabi Alonso said that the only two clubs he will love go coach if he chooses to leave Leverkusen is Liverpool and Real Madrid. So it's possible that whenever Ancelotti retires from Real Madrid and Xabi Alonso is still coaching Leverkusen, he might accept to move over to Madrid. Nobody knows what will be his decisions by then.
Real Madrid is everyone dream club, they have the money, they have the name, they have the game and they have the players and they have produce one of the greatest players in the history of football, it's understandable everyone to want to link up with Real Madrid but it seems like Anceloti is not up for retirement yet, he is still staying longer than we might expect him to leave.
Another reason why he might stay longer is Perez, he has been voted to stay as the president of Real Madrid, since they have a strong relationship with him, I don't think Xabi will get that job now, it will take more time or even never get it.