We study the phase behavior of single walled carbon nanotubes in aqueous solutions of surfactant molecules or amphiphilic polymers. Homogeneous dispersions can be obtained by using sodium dodecyl sulfate (SDS) in a well-defined concentration range. In contrast, polyvinyl alcohol (PVA) is not efficient at stabilizing the tubes. Carbon nanotubes stick with each other when PVA is added to homogeneous dispersions initially stabilized by SDS. This behavior is the basis of a simple method that we developed to assemble single walled carbon nanotubes into indefinitely long ribbons and fibers. The processing consists of dispersing the nanotubes in SDS solutions, re-condensing the nanotubes in the flow of a PVA solution to form a nanotube mesh, and then collating this mesh to a nanotube fiber. Flow induced alignment may lead to a preferential orientation of the nanotubes in the mesh that has the form of a ribbon. Unlike classical carbon fibers, the nanotube fibers can be strongly bent without breaking. Their obtained elastic modulus is 10 times higher than the modulus of high-quality bucky paper.