create and store large XML output in SQL
<p>I have a query that gives approximately <strong>four hundred thousand records</strong> [400000], up to <em>18mb</em>.<br>
I parsed the output to XML output, using:</p>

<pre><code>for xml path('url'), Root('urlset')
</code></pre>

<p>Now, query result doesn't show complete XML. 
when I try to view in XML SQL window, not able to export in an XML file.  </p>

<p><strong>ERROR:</strong> </p>

<p><img src="https://i.stack.imgur.com/9IoDF.png" alt="test"></p>

<p>I have done below practices as suggested in other posts:</p>

<ul>
<li><a href="https://stackoverflow.com/a/18781126/3682162">Run This Script</a> to enable xp_cmdshell</li>
<li>Increase <a href="http://blog.extreme-advice.com/2013/03/05/error-fix-unable-to-show-xml-the-following-error-happened-there-is-an-unclosed-literal-string/" rel="nofollow noreferrer">XML data capacity</a> to <strong>Unlimited</strong> in Options >> Result to Grid</li>
</ul>

<p>Still the same error! How to resolve this?  </p>