Add support multiple groups and fix xml structure