It also affects the digital markup of music. Music can't be expressed with a tree structure as there is lots of overlap.
A simple example is a slur. It crosses bar lines. <bar1> ... <slur> ... </bar1> ... </slur> <bar2> uhoh!
In fact there are many mutually incompatible hierarchies in music engraving.
It's funny though MusicXML is a popular interchange format, but internally looks nothing like what one would naively expect.
Ditto control flow. It’s tempting to think of repeat bars, DC al fines, codas etc hierarchical structures when in fact they are imperative GOTOs and always have been.