[en] The environments of both hot and cool stars are the sites of highly dynamic processes involving motion of gas and plasma in winds, flows across shocks, plasma motions in closed magnetic fields, or streams along magnetospheric accretion funnels. X-ray spectroscopy has opened new windows toward the study of these processes. Kinematics are evident in line shifts and line broadening, and also more indirectly through the analysis and interpretation of density-sensitive lines. In hot stellar winds, expanding-wind kinematics are directly seen in broadened lines although the broadening has turned out to often be smaller than anticipated, and some lines are so narrow that coronal models have been revived. Although X-ray spectra of cool stars have shown line shifts and broadening due to the kinematics of the entire corona, e.g., in binary systems, intrinsic mass motions are challenging to observe at the presently available resolution. Much indirect evidence for mass motion in magnetic coronae is nevertheless available. And finally, spectral diagnostics has also led to a new picture of X-ray production in accreting pre-main sequence stars where massive accretion flows collide with the photospheric gas, producing shocks in which gas is heated to high temperatures. We summarize evidence for the above mechanisms based on spectroscopic data from XMM-Newton and Chandra.