Magnetic fields can be created in stably stratified (non-convective) layers in a differentially rotating star. A magnetic instability in the toroidal field (wound up by differential rotation) replaces the role of convection in closing the field amplification loop.Tayler instability is likely to be the most relevant magnetic instability. A dynamo model is developed from these ingredients, and applied to the problem of angular momentum transport in stellar interiors. It produces a predominantly horizontal field. This dynamo process is found to be more effective in transporting angular momentum than the known hydrodynamic mechanisms. It may account for the observed pattern of rotation in the solar core.