X-ray fluorescence spectroscopy is one of the most powerful methods for the understanding of the electronic structure of matter. We report here on fluorescence experiments in the 2 to 6 keV photon energy range using tunable synchrotron radiation and the resulting experimental programs on resonant inelastic scattering in atoms and on polarization measurements in resonant molecular excitations