Crystal chemistry of MX · MgX2 · 6H2O type compounds