Line spectroscopy with spatial resolution of laser-plasma X-ray emission