The Gaia-ESO Survey: Stellar content and elemental abundances in the massive cluster NGC 6705