Perhaps one of our Catalan friends can clarify this further, but I believe it is also used sometimes where "j" is used in Castellano, as in "La caixa" (La caja in Castellano) or Xavi. Is this a case where it depends on the word used? It may have come that way from Latin and the other Latin based languages derived it differently.
Xavi, obviously, is Catalan. In the Catalan language, the letter "X" at the beginning of the word denotes a sound expressed in the IPA as "ɕ" that doesn't have a real analog in English and is, if I'm reading this article right, not really the same as the "ch" sound as in the English word "chair", but rather is, I think (and I'm not an expert, just a dabbler), most literally somewhere between "ch" and the "zh" sound like in the English word "vision". (If I recall correctly from the spring, Nick Simons on English-language Radio Barca doesn't exactly say "cha-bee", there's almost more of a "j" sound to it.) But that doesn't really get to the heart of the issue, because we all more or less know how to pronounce "Xavi". The reason there's a difference in the pronunciation that we heard during the WC is because Xabi Alonso is Basque, not Catalan. In the Basque language, the letter "X" makes the sound "ʃ", which is "sh" as in "shout" in English. "ch" as in "chair" (or as in "Xavi", more or less) is denoted in Basque by the characters "tx", as in "Txiki Begiristain". If I'm wrong about any of this, though, please feel free to correct me. Edit to add: The linked interview is from the Madrid-based TV channel Cuatro, so I don't know that it can necessarily take it for granted that the interviewers are pronouncing Xavi's name as it would properly be pronounced in Catalunya. More importantly, as the title would suggest, the interview does in fact feature Xavi playing the vuvuzela (starting roughly at the 5:20 mark), and is worth a watch because Xavi trying to play the vuvuzela is funny.
On the "th" soundings: I am of Latin American background, and we pronounce the soft "c" sounds with a "c" like we do in English. But in Spanish, they use "th" sound instead; like "zeta" (zero) would be "theta". And onto Xavi (and also Xabi Alonso), well that name always plays on my mind... It's "Cha vee" isn't it?
This list of pronunciation is pretty clear and easy to follow. Thought it might be of interest as it covers the whole language.