Support heterogeneous types at the top level in XmlProvider (fix #294)