Cadmium level and soil type played a selective role in the endophytic bacterial community of hyperaccumulator Sedum alfredii Hance.