Retrieveing DB Values in XML Format using XML EXPLICIT
XML EXPLICIT
EXPLICIT enables you to to define each level of hierarchy and how each level is going to look. In order to define hierarchy, you create internally a table called universal table.
select 1 as Tag, NULL as Parent, EmployeeId as [Employee!1!EmployeeID], Notes as [Employee!1!cdata]
from Employees order by EmployeeID
for XML EXPLICITOutput:
<Employee EmployeeID="1" cdata="Education includes a BA in psychology from Colorado State University in 1970. She also completed "The Art of the Cold Call." Nancy is a member of Toastmasters International."/><Employee EmployeeID="2" cdata="Andr