  To maximize the discovery potential of future synoptic surveys, especially in
the field of transient science, it will be necessary to use automatic
classification to identify some of the astronomical sources. The data mining
technique of supervised classification is suitable for this problem. Here, we
present a supervised learning method to automatically classify variable X-ray
sources in the second \textit{XMM-Newton} serendipitous source catalog
(2XMMi-DR2). Random Forest is our classifier of choice since it is one of the
most accurate learning algorithms available. Our training set consists of 873
variable sources and their features are derived from time series, spectra, and
other multi-wavelength contextual information. The 10-fold cross validation
accuracy of the training data is ${\sim}$97% on a seven-class data set. We
applied the trained classification model to 411 unknown variable 2XMM sources
to produce a probabilistically classified catalog. Using the classification
margin and the Random Forest derived outlier measure, we identified 12
anomalous sources, of which, 2XMM J180658.7$-$500250 appears to be the most
unusual source in the sample. Its X-ray spectra is suggestive of a ULX but its
variability makes it highly unusual. Machine-learned classification and anomaly
detection will facilitate scientific discoveries in the era of all-sky surveys.
