A green function approach of low-energy electron diffraction