Motivated by the problem of finding a "well-foundedness principle" for totally disconnected, locally compact (t.d.l.c.) groups, we introduce a class \(\mathscr{E}^{\mathscr{S}}\) of t.d.l.c. groups, containing P. Wesolek's class \(\mathscr{E}\) of (regionally) elementary groups but also including many groups in the class \(\mathscr{S}\) of nondiscrete compactly generated topologically simple t.d.l.c. groups. The class \(\mathscr{E}^{\mathscr{S}}\) carries a well-behaved rank function and is closed under taking directed unions, open subgroups, closed normal subgroups, extensions and quotients. The class \(\mathscr{E}^{\mathscr{S}}\) also includes other well-studied families of t.d.l.c. groups that are not contained in \(\mathscr{E}\), including all locally linear t.d.l.c. groups, all complete geometric Kac--Moody groups over finite fields, the Burger--Mozes groups \(U(F)\) where \(F\) is primitive, and \(2^{\aleph_0}\) more examples of groups in \(\mathscr{S}\) that arise as groups acting on trees with Tits' independence property (P). On the other hand, \(\mathscr{E}^{\mathscr{S}}\) excludes the Burger--Mozes groups \(U(F)\) where \(F\) is nilpotent and does not act freely. By contrast, a larger class \(\mathscr{E}^{[\mathrm{Sim}]}\) (with similar closure properties to \(\mathscr{E}^{\mathscr{S}}\)) is closed under forming actions on trees with property (P).