For All Table recordsSelect(Select * from test1 Order By ID FOR XML AUTO, ELEMENTS XSINIL);
Output:-
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID>1</ID>
<Name>Test1</Name>
<Address>Nagpur</Address>
</test1>
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID>2</ID>
<Name>Test1</Name>
<Address>Nanded</Address>
</test1>
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID>3</ID>
<Name>Test1</Name>
<Address>Pune</Address>
</test1>
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID>4</ID>
<Name>Test1</Name>
<Address>Jabalpur</Address>
</test1>For specific recordSelect(Select * from test1 WHERE ID = 1 Order By ID FOR XML AUTO, ELEMENTS XSINIL);
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID>1</ID>
<Name>Test1</Name>
<Address>Nagpur</Address>
</test1>