# \hat{x}_i

How do I enter (without using raw TeX)
\hat{x}_i?

I seem to always end up with \hat{x_i}, which isn't the same (and doesn't
look correct)