XMM observations of M 87. II. Abundance structure of the interstellar and intergalactic medium