ST has done it quite elegantly: they sniff out the capacitance variations between micromachined or etched beams of coated silicon placed perpendicular to each other. Movement causes the masses at the ends of the beams to follow more "slowly", causing a measurable variation in capacitance due to bending of the structures. The datasheet tells you more, just see ST's web pages.