[MusicXML Export] invalid MusicXML when instruments are missing from drumset
When a score contains percussion notes that do not have an instrument defined in the drum set, the MusicXML file exported is invalid. When importing this file, schema validation fails with a message such as "There is one IDREF value with no corresponding ID: P1-I81.". Cause is that MuseScore generates score-instrument and midi-instrument elements only for the instruments defined in the drum set.
Reproduce by creating a percussion score and remove any instrument actually used by editing the drum set.
File dusk.mscx in [#09331] also shows this problem.
Easiest solution is probably to generate (nameless) score-instrument and midi-instrument elements for these instruments.
Sample file attached that illustrates the issue.