Charge density waves in layered metals observed by X-ray photoemission