The exact steps will vary based on how exactly you’re defining “branch”, but MEPover has nodes for getting both(?) upstream and downstream elements in a system. You can also collect connected elements recursively or, even simpler, just get every element within the system you selected.
If you can define “branch” and the specific extent to which you want your selection to cover then we can probably give you a better answer.