For some output formats (in particular, XML as generated by ApiFormat), ID-based maps are problematic, and should be replaced by plain lists (with a tag name meta-marker set, see T78652).
NOTE: Before implementing this, first investigate whether this is still needed with the overhauled ApiResult class. Perhaps just having the meta-marker set is sufficient.