Using any nonnegative function with a nonpositive derivative along trajectories to define a virtual output, the classic LaSalle invariance principle can be extended to switched nonlinear time-varying (NLTV) systems, by considering the weak observability associated with this output. The concept of weak observability reflects the information of the limiting behavior of state trajectories hidden in the zero locus of the output. In the context of switched NLTV systems, weak observability can be explored using the recently established framework of limiting zeroing-output solutions. Adding to this, a new approach to show uniform global attractivity of a closed set (without assuming uniform Lyapunov stability or dwell-time conditions) is proposed. A further extension of the generalized LaSalle invariance principle allows the consideration of cascaded switched NLTV systems, which is used to characterize how consensus in a leaderless swarm of nonholonomic robots allowing for switching communication topologies may be established.