Exchange coupling in pure hcp Gd and magnetostructural transition in Gd5(Si2Ge2)