Make hierarchy GUI


How can i make a hierarchy descript above in canvas GUI
I know how to load xml but dont know how to make a GUI that can expand and collapse like that

You can use a TreeView for UI Toolkit. UGUI may have something similar.

Unless you have to work with existing XML files, don’t use XML. It’s verbose, slow (at least the .NET/Mono implementations) and not human readable. For text description json is the most widely used format and has built-in support by Unity through no less than three APIs.