Barcelona legend Xavi has announced his intention to leave the club at the end of the season to join Qatari club Al Sadd.