Sort bitfields before use in XML writer and restructured text generator