The XMM-Newton view of magnetars