Nanoelectromechanical Systems (NEMS) are among the best candidates to measure interactions at nanoscale [1-6], especially when resonating oscillators are used with high quality factor [7, 8]. Despite many efforts [9, 10], efficient and easy actuation in NEMS remains an issue [11]. The mechanism that we propose, thermally mediated Center Of Mass (COM) displacements, represents a new actuation scheme for NEMS and MEMS. To demonstrate this scheme efficiency we show how mechanical nanodis- placements of a MEMS is triggered using modulated X-ray microbeams. The MEMS is a microswing constituted by a Ge microcrystal attached to a Si microcantilever. The interaction is mediated by the Ge absorption of the intensity modulated X-ray microbeam impinging on the microcrystal. The small but finite thermal expansion of the Ge microcrystal is large enough to force a nanodisplacement of the Ge microcrystal COM glued on a Si microlever. The inverse mechanism can be envisaged: MEMS can be used to shape X-ray beams. A Si microlever can be a high frequency X-ray beam chopper for time studies in biology and chemistry.