X-ray Diagnostics of Astrophysical Plasmas