X-ray and ultraviolet (UV) observations of the outer solar atmosphere have been used for many decades to measure the fundamental parameters of the solar plasma. This review focuses on the optically thin emission from the solar atmosphere, mostly found at UV and X-ray (XUV) wavelengths, and discusses some of the diagnostic methods that have been used to measure electron densities, electron temperatures, differential emission measure (DEM), and relative chemical abundances. We mainly focus on methods and results obtained from high-resolution spectroscopy, rather than broad-band imaging. However, we note that the best results are often obtained by combining imaging and spectroscopic observations. We also mainly focus the review on measurements of electron densities and temperatures obtained from single ion diagnostics, to avoid issues related to the ionisation state of the plasma. We start the review with a short historical introduction on the main XUV high-resolution spectrometers, then review the basics of optically thin emission and the main processes that affect the formation of a spectral line. We mainly discuss plasma in equilibrium, but briefly mention non-equilibrium ionisation and non-thermal electron distributions. We also summarise the status of atomic data, which are an essential part of the diagnostic process. We then review the methods used to measure electron densities, electron temperatures, the DEM, and relative chemical abundances, and the results obtained for the lower solar atmosphere (within a fraction of the solar radii), for coronal holes, the quiet Sun, active regions and flares.