Time-independent swirling flows in rotationally symmetric pipes of constant and varying diameter are constructed using variational techniques. Critical flows in pipes of uniform cross section are found by extremizing the cross-sectional energy at constrained value of the cross-sectional helicity and the axial how rate. Discrete classes of hows are found explicitly, parameterized by the radius and the value of the cross-sectional helicity. These flows are steady Beltrami-type hows and are independent of the axial co-ordinate. Solution branches can show the phenomenon of flow-reversal at the central axis of the pipe: the axial velocity becomes negative with increasing radius. An approximation for swirling flows in a pipe with varying circular cross section is constructed in a quasi-homogeneous way as a succession in the axial direction of critical flows in uniform pipes. With the changing value of the radius, the value of the cross-sectional helicity is determined by the requirement that the approximation satisfies the correct energy and flux conservation. It will be shown that these requirements are equivalent to satisfying the necessary solvability conditions that arise from a perturbation analysis around the quasi-homogeneous approximation. The approximate flows have the property that in lowest order approximation the local cross-sectional energy density increases linearly with R, while the local cross-sectional helicity density is constant.