We derive Donsker-Vardhan type results for functionals of the occupation times when the underlying random walk on Z is in the domain of attraction of an operatorstable law on R. Applications to random walks on wreath products (also known as lamplighter groups) are given.