title: Are multiple XML declarations in a document well-formed XML?
body: <p>Is having two XML declarations in the same document well-formed XML?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;a&gt;
   &lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;b&gt;
    hello
   &lt;/b&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I believe it is not, however I can't find a source to back me up on this.</p>
  
  <p>From <a href="http://www.w3.org/TR/REC-xml/" rel="nofollow">Extensible Markup Language (XML) 1.0 </a></p>
  
  <blockquote>
    <p>Definition: XML documents SHOULD begin with an XML declaration which
    specifies the version of XML being used.</p>
  </blockquote>
  
  <p>The pesky word "should" is there. It says ideally the document starts with an XML declaration. It says nothing about having another one within the document.</p>
  
  <blockquote>
    <p>The document type declaration MUST appear before the first element in
    the document.</p>
  </blockquote>
  
  <p>This is close, but it doesn't talk about the XML declaration itself, even though it should come before it.</p>