According to what I have learned, the X in the old spanish had the sound of the english H, or the spanish J, for that matter. That is why Mexico is pronounced Mejico and not Mecsico. The same thing goes for Texas and Don Quixote.
Can you tell me what sound the J had in spanish before this change? I know that the J was invented in the middle ages, but Don Quixote was written long after that time, and Mexico and Texas were named after the medieval period, which means the J already existed in that same time, but had a different sound since the X was used in its place.