Xatu's main problem is that its typing gives it a weakness to Thunderbolt, Ice Beam, and Rock Slide, and it doesn't resist Normal. It does have that great 4x Fighting resist and Earthquake immunity, but since most Pokémon with either of these moves will also have at least one of Rock Slide, Shadow Ball, Return, or Hidden Power Ghost, Xatu can't even abuse its resistances to switch in, unless the enemy has a Choice Band.
Grumpig or Hypno are usually a better choice if you want a supporter, Gligar takes on Pokémon that carry Fighting moves better, and Hypno is infinitely better at support. Xatu is simply outclassed by so many Pokémon, it's rarely worth the effort. At least it can come in on Choice Band Earthquakes.
This is mostly inferior to Celebi in OU, and Hypno / Lunatone outclass it in UU, except that it can also pass Wish. This lets you have Xatu absorb a hit as it passes out to a weakened Pokémon, letting that Pokémon take no damage as it receives the Wish. Unfortunately, Xatu has neither the defenses nor the typing to pull this off effectively.
If you are Quiet, you'll likely want to reduce your Speed IVs to 0, so that Xatu is more likely to take the hit than whatever you're passing to.
Xatu puts up a Reflect to protect itself from physical attacks, and then boosts its Special Defense with Calm Mind and attempts to sweep. Reflect and Wish are there to help out the whole team, and they give Xatu a good boost as well.
Xatu is a pretty horrible Pokémon and this is about all it can do. Switch in on a Will-O-Wisp or Thunder Wave from something; Synchronize it to them while curing yourself. After this has happened, you have essentially gained a free steal and have crippled that Pokémon.
Hidden Power Water is an option for Tyranitar in OU, and Hidden Power Fire hits Metagross and Skarmory. Xatu resists Fighting x4, so if you give it Quick Attack, it can be a Reversal counter. Xatu's Attack isn't much worse than its Special Attack, so you could try out physical attacks on it, but then you're just a worse Fearow except for your Fighting resist. Xatu can use Hidden Power Ice to get a surprise OHKO on Gligar, something Hypno and Grumpig can't do without taking a Swords Danced hit, and Gligar might expect Ice Punch from them and switch out, anyway.
Rest can be used with the Trait Early Bird to make Rest last a single turn, or you can use it with Synchronize to switch into status, Synchronize it, and then Rest off the status later, and when you wake up, Xatu can Synchronize someone else. This is probably best done with a Sleep Talk set, however, so Xatu isn't completely a sitting duck while it's Sleeping. Thunder Wave or Toxic can be added on as status.
Xatu should go to 310 Speed max, as that will make Xatu faster than neutral nature Scyther, Electabuzz, and Manectric, as well as Jolly Kangaskhan and Timid Pikachu; this requires 224 Speed EVs and a +Speed nature. 301 Speed makes it faster than Jolly Hitmonlee, Adamant Fearow, and neutral nature Tentacruel, as well as Jolly Gligar; this requires 192 EVs and a +Speed nature. 280 Speed beats Adamant Kangaskhan and Modest Pikachu; Xatu needs 216 EVs and a neutral nature to reach this. The lowest most Xatu should go is probably 270 Speed, to beat Adamant Gligar; this needs 176 EVs and a neutral nature.
Supporter Xatu should max HP, and put the rest in Special Attack, whereas sweeper Xatu should do the opposite—max Special Attack, and put the rest in HP.
Checks and Counters
OU counters: Snorlax, Regice, and Blissey will easily stop any special set, and won't take enough damage from a physical hit if you try and run a Choice Band Xatu for the surprise factor to make it worth it. Xatu can potentially use Wish and Calm Mind to actually beat Blissey, unless it has Toxic, or can Calm Mind itself, but even Thunder Wave will ruin Xatu's chance at a sweep when they just bring in a physical attacker and OHKO you. Tyranitar and Metagross laugh at anything Xatu can throw at them, except Dragon Dancing Tyranitar won't like Thunder Wave. Raikou, Zapdos, and other Electric Pokémon can do more damage than Xatu can defend against with Calm Mind and Wish. Any physical attacker that isn't weak to Psychic can put the hurt on Xatu, really.
UU counters: Manectric, Electabuzz, and other Electrics can damage Xatu too fast, just like in OU. Solrock and Lunatone laugh at anything Xatu can throw at it, save Hidden Power Dark, and even that won't do enough to counter Solrock's Rock Slide or Shadow Ball. Aggron doesn't care about Thunder Wave that much, resists Psychic and Hidden Power Dark, and has STAB Rock Slide to annihilate Xatu. Sableye is immune to Psychic and can hit Xatu hard with STAB Shadow Ball or Faint Attack. Banette OHKOs Xatu with Shadow Ball, but doesn't have the Special Defense to switch in that often. Kangaskhan takes very little from Xatu's attacks, and can just beat it down with STAB Return or Shadow Ball, and, if it is abusing Early Bird Rest, you can't even cripple it with Thunder Wave. Hypno and Grumpig can just come in and Calm Mind up with you, and they will win the Calm Mind war most of the time, especially if they have Ice Punch or ThunderPunch.