Apparatus for analysing a sample using x-ray, neutron ray, gamma ray or particle-beam radiation to analyze the sample, the apparatus comprising: a sample chamber having a surface into which a sample cavity is formed, said sample cavity forming a portion of a sample path through which the sample is moveable, an analysis engine having a radiation interface; a barrier, comprising a film transparent to the radiation, and separating the sample from the engine, the barrier moveable relative to the radiation interface and over the sample cavity; a barrier movement system to effect movement of said barrier; and a plate opposing the sample cavity having an aperture allowing passage of the radiation to and from the sample cavity, wherein the barrier is disposed between the surface of the sample chamber and the plate, and wherein the sample chamber is moveable relative to the plate to increase and decrease pressure on the barrier, the apparatus being configured to decrease the pressure on the film to allow movement of the barrier, wherein the sample path is pressurized and the barrier maintains the sample in said cavity, and wherein the sample is a liquid, the sample path comprises at least a portion of a pressurized pipeline through which the liquid is flowing, and the analysis engine performs a compositional analysis of the liquid while the liquid is flowing, characterized in that the analysis engine includes a focusing device which produces a focused beam of said radiation through the barrier, and toward said sample, and in that the apparatus further comprises an expandable ring disposed between the sample chamber and the plate, and around the sample cavity, to maintain an adequate pressure in the sample path. a sample chamber having a surface into which a sample cavity is formed, said sample cavity forming a portion of a sample path through which the sample is moveable, an analysis engine having a radiation interface; a barrier, comprising a film transparent to the radiation, and separating the sample from the engine, the barrier moveable relative to the radiation interface and over the sample cavity; a barrier movement system to effect movement of said barrier; and a plate opposing the sample cavity having an aperture allowing passage of the radiation to and from the sample cavity, wherein the barrier is disposed between the surface of the sample chamber and the plate, and wherein the sample chamber is moveable relative to the plate to increase and decrease pressure on the barrier, the apparatus being configured to decrease the pressure on the film to allow movement of the barrier, wherein the sample path is pressurized and the barrier maintains the sample in said cavity, and wherein the sample is a liquid, the sample path comprises at least a portion of a pressurized pipeline through which the liquid is flowing, and the analysis engine performs a compositional analysis of the liquid while the liquid is flowing, characterized in that the analysis engine includes a focusing device which produces a focused beam of said radiation through the barrier, and toward said sample, and in that the apparatus further comprises an expandable ring disposed between the sample chamber and the plate, and around the sample cavity, to maintain an adequate pressure in the sample path.