We propose a protocol for the generation of NOON states of resonator modes. The physical model is composed of two Kerr-nonlinear resonators and a four-level qudit. Using the off-resonant couplings between the resonators and the qudit, qudit-level-dependent frequency shifts on the two resonators are induced. The frequency shifts allow us to drive different resonators to the N-photon state when the qudit is in different intermediate levels. Consequently, the generation of NOON states with arbitrary photon number N can be completed in only three steps, i.e., driving the qudit to a superposition state of the two intermediate levels, driving one of the resonators to its N-photon state, and driving the qudit back to its ground level. Numerical simulations show that, in the regime of strong Kerr nonlinearity and coupling strengths, the protocol can produce the NOON state with high fidelity in the cases of different photon numbers. In addition, it is possible for the protocol to produce acceptable fidelity in the presence of systematic errors and decoherence factors. Therefore, the protocol may provide some useful perspectives for effective generation of photonic NOON states.