There isn’t exactly an official published Xanathar Stat Block. You can find a suggestion for one in Waterdeep: Dragon Heist. Of course, based on Xanathar’s lore, this is merely a Xanathar, and not necessarily the Xanathar. This Xanathar is just a beholder stat block with a few magic rings that they wear on their eye stalks.
Xanathar wears a ring of invisibility, a ring of mind shielding and a ring of resistance (force). The most important one, by far, is the ring of invisibility. For most creatures, invisibility only has so much utility in combat, as it is ended by attacks or spellcasting. For a beholder, though, it is a very powerful effect. The primary offensive weapon of a beholder, its eye rays, are not technically attacks.
Because of this, the beholder can use eye rays and then move away from the location where it discharged them. As depicted in official art of beholders, the eye rays are visible, so using them will reveal the location of Xanathar. Xanathar will be tricky for players to find, but not impossible due to a beholder relatively low movement speed. This is especially true if it chooses to use its eye rays as legendary actions. Beholders don’t have movement as an option for their legendary actions, so once they use their eye ray, the players know their location until their next turn.
You can see some other stat blocks for famous D&D characters below or check out suggested pricing for nearly every published magic item.