Compact flash X-ray sources and their applications