title: Xml parsing error in ios to get attribute values
body: <p>I have problem with xml parsing</p>
  
  <p>I got an XML response from the server with this header:</p>
  
  <pre><code>?xml version="1.0"?
  </code></pre>
  
  <p>So I can't parse it and I can't get my attribute values. In same structure static I will parse else it won't work .</p>
  
  <p>If i add my header file statically like this  <code>?xml version=\"1.0\" encoding=\"UTF-8\"?</code>  it will work fine .
  However if I dynamically append this <code>"encoding=\"UTF-8\"</code> in my xml it shows an error</p>
  
  <pre><code>Parser error Error Domain=NSXMLParserErrorDomain Code=64 "The operation couldn’t be completed. (NSXMLParserErrorDomain error 64.)"
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/18307330/after-did-finish-loading-i-cant-get-my-xml-attribute-values-in-ios">see the full xml file</a></p>