Encode child counts as an array, not as a switch.