The first argument to function XMLElement defines an identifier that names the root XML element to be created. The root-element identifier argument can be defined and, if it is defined, the identifier must not be NULL or else an error is raised.
This is the syntax:
I want to do a very simple test. I use the ALL_USERS view, in order to the run the first select.
Let's reformat the output
Ok. How you can see, the XMLElement, transform the column in a XML. Let's see more on the ALL_USERS view:
I add a second column in my select (green and red).
Because of DATE data type, I change to output using the TO_CHAR function
So I obtain a more complex XML.