We can use For XML Auto
for the result:-The FOR XML extension allows the creation of XML from relational data.
SELECT employee_id,employee_name,pan_number,ldap Elements:-Specifies that the columns are returned as sub-elements to the table element. Otherwise, they are mapped as attributes
FOR XML AUTO,ELEMENTS;