A simple x-ray fluorescence experiment suitable for graduate and undergraduate laboratories is described. The experiment uses a NaI(Tl) x-ray spectrometer, a weak Co57 radioactive source (∼105 Bq), and medium-Z targets of silver, cadmium, indium, and tin. The K x-ray fluorescence yield, ωk, and K x-ray production cross section, σk, are measured for these targets. Accurate results are achieved by adopting a 2π detection geometry and by optimizing target dimensions for this experimental configuration. The experiment can be completed in 4 h and is suitable for student laboratories.