SELECT XMLElement("Country",
  XMLAttributes(code AS code),
  XMLELEMENT(name, name),
  (SELECT XMLConcat(
     XMLElement("NoOfCities", count(*)),
     XMLAgg(XMLElement("city",name)))
   FROM City
   WHERE country=code))
FROM country;
