title: How can I output XML stored string from controller or view in Codeigniter
body: <p>I want to show XML content header type output from view but getting an error. Below is the code that I am putting into my view.</p>
  
  <pre><code>&lt;?php header("Content-Type: text/xml;charset=iso-8859-1"); ?&gt;
  &lt;?php '&lt;?xml version="1.0" encoding="UTF-8" ?&gt;' ?&gt;
  
  
  &lt;urlset xmlns=""&gt;
      &lt;url&gt;
          &lt;loc&gt;Something&lt;/loc&gt; 
          &lt;priority&gt;1.0&lt;/priority&gt;
      &lt;/url&gt;
  
      &lt;!-- My code is looking quite different, but the principle is similar --&gt;
  
      &lt;url&gt;
          &lt;loc&gt;Somthing&lt;/loc&gt;
          &lt;priority&gt;0.5&lt;/priority&gt;
      &lt;/url&gt;
  
  
  &lt;/urlset&gt;
  </code></pre>
  
  <p>And that is the error that I am getting from it. </p>
  
  <p><a href="https://i.stack.imgur.com/cMRvk.jpg" rel="nofollow noreferrer">Click to view Error Message</a></p>