  The asymptotic giant branch (AGB) phase of stellar evolution is common to
most stars of low and intermediate mass. Most of the carbon and nitrogen in the
Universe is produced by AGB stars. The final fate of the AGB envelopes are
represented by planetary nebulae (PN). By studying PN abundances and compare
them with the yields of stellar evolution is possible to quantify carbon and
nitrogen production, and to study cosmic recycling in galactic and Magellanic
Cloud populations. In this paper we present the latest results in PN chemical
abundance analysis and their implication to the chemical evolution of the
galaxy and the Magellanic Clouds, with particular attention to carbon
abundance, available only thanks to ultraviolet spectroscopy.
