The Composite design pattern provides a solution:
Define separate Composite objects that compose the objects of a part-whole hierarchy into a tree structure.
Work through a common Component interface to treat Leaf and Composite objects uniformly.
Describing the Composite design in more detail is the theme of the following sections.
See Applicability section for all problems Composite can solve.

Background Information