New Zealand ex-politician gives valedictory speech