Yes, if the stem is green and contains chlorophyll, it can prepare food for the plant. While most photosyntesis takes place in the leaves, some photosynthesis takes place in the stem too. The stem of the cactus plant synthesizes its own food because there are no leaves.