  The variational approach of Gunnarsson and Sch\"onhammer to the Anderson
impurity model is generalized to study d-wave superconductors in the presence
of dilute spin-1/2 impurities. We show that the local moment is screened when
the hybridization exceeds a nonzero critical value at which the ground state
changes from a spin doublet to a spin singlet. The electron spectral functions
are calculated in both phases. We find that while a Kondo resonance develops
above the Fermi level in the singlet phase, the spectral function exhibits a
low-energy spectral peak below the Fermi level in the spin doublet phase. The
origin of such a ``virtual Kondo resonance'' is the existence of low-lying
collective excitations in the spin-singlet sector. We discuss our results in
connection to recent spectroscopic experiments on Zn doped high-T$_c$
superconductors.
