Pope Benedict XVI waves to pilgrims gath