It highly depends on what you want to do with the data, and if your data is contextual or not (i.e. if a label has a special meaning when under some special parents)
A recursive DIY parsing function may be the simplest to implement and maintain.