Theory of core-level XPS on undoped cuprates