X-ray Luminosity Function of Optically Selected Galaxy Groups