I use SqlParser class provided by SqlServer to parse the AST of a sql script, like I answered in this post: https://stackoverflow.com/a/34103965/3828013.
its output is a xml document like below. But I have searched a lot, and can not find any related document. Anyone knows can give me the link.
<?xml version="1.0" encoding="utf-8"?>
<SqlScript Location="((1,1), (92,1))">
<Errors />
<SqlBatch Location="((91,3), (92,1))">
<!--
-->
<Tokens>
<Token location="((91,3), (92,1))" id="651" type="LEX_WHITE">\n</Token>
</Tokens>
</SqlBatch>
</SqlScript>