X-ray studies of magnetism