Theory of attosecond electron dynamics induced by strong XUV and X-ray laser fields