title: C# Remove first empty line in View
body: <p>I have a query that I'm sure I've already passed on to someone else.
  When rendering the view it always shows an empty line at the beginning and this generates the following error:</p>
  <p><strong>XML reading error: text or XML declaration in a different place from the beginning of the entity Location:</strong></p>
  <p><strong>View: IndexSitemap.cshtml</strong></p>
  <pre><code>    &lt;xsl:stylesheet version=&quot;2.0&quot;
          xmlns:html=&quot;http://www.w3.org/TR/REC-html40&quot;
          xmlns:image=&quot;http://www.google.com/schemas/sitemap-image/1.1&quot;
          xmlns:sitemap=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;
          xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
      &lt;xsl:output method=&quot;html&quot; version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; indent=&quot;yes&quot;/&gt;
      &lt;xsl:template match=&quot;/&quot;&gt;
          &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  .
  .
  .
          &lt;body&gt;
  </code></pre>
  <p><strong>Controller:</strong></p>
  <pre><code>public ActionResult MainSitemap()
          {
              Response.ClearHeaders();
              Response.AddHeader(&quot;content-type&quot;, &quot;text/xml&quot;);
              //Response.AddHeader(&quot;content-type&quot;, &quot;application/vnd.ms-excel&quot;);
              return View(&quot;IndexSitemap&quot;);
          }
  </code></pre>
  <p><strong>Result:</strong></p>
  <pre><code>
  
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
      &lt;xsl:stylesheet version=&quot;2.0&quot;
          xmlns:html=&quot;http://www.w3.org/TR/REC-html40&quot;
          xmlns:image=&quot;http://www.google.com/schemas/sitemap-image/1.1&quot;
          xmlns:sitemap=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;
          xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
      &lt;xsl:output method=&quot;html&quot; version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; indent=&quot;yes&quot;/&gt;
      &lt;xsl:template match=&quot;/&quot;&gt;
          &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  .
  .
  .
          &lt;body&gt;
  </code></pre>
  <p>Thank you</p>