CTAN has a new package: ifxetex
Provides an analogue to ifpdf for XeTeX; this package works for either LaTeX or Plain using eTeX extensions.
See this package at http://tug.ctan.org/tex-archive/macros/xetex/latex/ifxetex . You may get a better network connection by using a CTAN mirror near to you; see http://tug.ctan.org/tex-archive/README.mirrors . Our service is supported by the TeX Users Group http://www.tug.org . Please join a users group; see http://www.tug.org/usergroups.html .
ifxetex – Am I running under XeTeX?
A simple package which provides an \ifxetex conditional, so that other code can determine that it is running under XeTeX.
The package requires the e-TeX extensions to the TeX primitive set.