 CREATE TABLE CityXML
   ( name VARCHAR2(35),
     province VARCHAR2(35),
     country VARCHAR2(4),
     population XMLType,
     coordinates XMLType);

 INSERT INTO CityXML
 (SELECT name, province, country,
   XMLElement("Population",
              XMLAttributes(95 as year),
              population),
   CASE WHEN longitude IS NULL THEN NULL
        ELSE XMLElement("Coordinates",
               XMLElement("Longitude", longitude),
               XMLElement("Latitude", latitude))
    END
  FROM city);
