I've had my XG350 into the dealer for hesitation and surging many times.
It seems there is something wrong with the Mass Airflow Sensor, or the
Traction Control Module, or even the Power Control Module. Whatever it
is, Hyundai are in denial about this problem. All the dealers know this
is an issue.