If only it were so simple. What plants actually achieve is the synthesis of sugar by joining carbon dioxide to water, using enrgy from light. I won't start explaining the biochemistry of it because it'll be easy enough to find on the web.
Simulating it would be a clever way of getting rid of carbon dioxide from the air... wouldn't it? A lot of clever people are trying to find efficient ways to do just that.