  We report on gamma-ray orbital modulation of the transitioning millisecond
pulsar binary XSS J12270-4859 detected in the Fermi Large Area Telescope (LAT)
data. We use long-term optical data taken with the XMM-Newton Optical Monitor
and the Swift UltraViolet Optical Telescope to inspect radio timing solutions
that are limited to relatively short time intervals, and find that
extrapolation of the solutions aligns well the phasing of the optical data over
15 years. The Fermi-LAT data folded on the timing solutions exhibit significant
modulation (p = 5x10^-6) with a gamma-ray minimum at the inferior conjunction
of the pulsar. Intriguingly, the source seems to show similar modulation in
both the low-mass X-ray binary (LMXB) and the millisecond pulsar (MSP) states,
implying that mechanisms for gamma-ray emission in the two states are similar.
We discuss these findings and their implications using an intra-binary shock
scenario.
