I am new to XML , The task is to generate xml similar to below mentioned from table :
<A>
<a1>1</a1>
<a2>2</a2>
<a3 type="xyz">abc</a3>
<B>
<b1>11</b1>
<b2 ID ="b2_product" name="clothing" >
<c1>
<d1 type = "xlr1">d11</d1>
<d1 type = "xlr2">d12</d1>
</c1>
</b2>
</B>
Sql Table for this is :
Table A:
a1 a2 a3_type a3 b1 b2_ID b2_name xlr1 xlr2
1 2 xyz abc 11 b2_product clothing d11 d12
How to write SQL to generate XML from this table in given format of xml only.