Simplify logic in XML generator.
Simplify logic in XML generator.

Migrated from Sable/mclab@f110e5bfd9048850d169343024d7ac6a0ff31c56

Sable/mclab-core,Sable/mclab-core,Sable/mclab-core,Sable/mclab-core,Sable/mclab-core,Sable/mclab-core,Sable/mclab-core,Sable/mclab-core