Generating functions involving arbitrary products