Using the composite pattern