composite pattern with custom iterator to go through all composite
elements