The Formation of Hierarchical Systems