Create XML grouped by items