Sub-femtosecond EUV pulses via energy selective nonlinear stabilization in a waveguide