Scenario
The health care provider is asked to provide a report in XML format with patient's personal information together with their PMD document. The challenge is that patient's personal information is stored in a relational format unlike the PMD documents which are already in XML format.
Operation
The SQL/XML function XMLELEMENT takes relational data and returns XML values as XQuery element nodes. XMLELEMENT has an opposite effect to XMLTABLE function which returns XML data to relational format.
Solution
The patient information stored in the patient master table in relational format is returned as XML documents and sent to the requester.
Best Practices