Flow of Matter in Ecosystems