A novel technique for X-ray laser beam characterization