Aggregate. Returns a single XML result aggregated over a group of rows.
All results are concatenated (ignoring Nulls). Note that windows are not required with XMLAGG.
XMLELEMENT
The following example shows the construction of an element called "orders", where the children of orders are "orderid" elements, one of each from each resulting row of the join:
INSERT INTO OutStream SELECT XMLELEMENT("orders", XMLAGG(XMLELEMENT("orderid", orders.orderid))) FROM Orders KEEP 1 HOUR, Shipments;