XML from Data Base Examples tutorial
Making an XML element with attribute, a text content and a sublement XML element with attribute, a text content and a sublement

## Example 4

This example shows a use of the XMLELEMENT() for creating the xml element 'Employee' with the 'EmployeeID' attribute, text content that is concatenations of the value of the 'FirstName' column, of the blank character and of the value of the 'LastName', and the 'Title' subelement having 'title' attribute.

    select XMLELEMENT ('Employee', XMLATTRIBUTES ("EmployeeID"), "FirstName"||' '||"LastName",
                                    XMLELEMENT("Title", XMLATTRIBUTES ( "Title" as "title")))
    from "Demo"."demo"."Employees";