Oxygen is a waste product of photosynthesis: it comes out of the plant in respiration. All the oxygen in the atmosphere has its origin in plants (including those microorganisms which do photosynthesis)