SELECT XMLElement("Country",
         XMLAttributes(code AS car_code),
         XMLElement("Name",name),
         XMLElement("NoOfCities",
                    (SELECT count(*)
                     FROM City
                     WHERE country=country.code)))
FROM country
WHERE area > 1000000;

SELECT XMLElement("Country",
         XMLAttributes(code AS car_code),
         XMLElement("Name",name),
         (SELECT XMLElement("NoOfCities",count(*))
                       FROM City
                       WHERE country=country.code))
FROM country
WHERE area > 1000000;
