People diving on you are easy targets for your E and W epicenter. Landing either of those makes your other abilities free hits as well, more than enough damage to discourage reckless aggression. Just play very safe if any of your spells are on CD, or you'll lose every trade. You'll also die if you get dived by two people, but that wont happen unless you fuck up big time.
If you're dealing with multiple aggressive Champions, consider an early Rylais. The health and passive boost your survivability, and the passive indirectly boosts your damage by making your Q an easy setup for your other abilities, and letting you easily chain ult shots.
If you're ahead, or dealing with less divey Champions, or are experienced playing around them, Luden's is a good start. The added AP brings your combo to one-shot potential against squishes, and the passive greatly boosts your poke. The move speed also gives you more proactive survivability against mobile champions, if you mind your safety range.
You should be completely safe in teamfights with a decent frontline, because you just want to sit at max range and look for opportunities to snipe their backline. In fact, a good way to open teamfights as Xerath is to stay way back, ult, and use your shots to either zone or kill their carries. An ADC can't effectively deal damage or contend with your team's frontline while dodging your ult shots, and disrupting them is a much better use of your time than comboing their frontline for lackluster damage, which is all you'll be able to do safely when teamfights begin.