Is having two XML declarations in the same document well-formed XML?
<?xml version="1.0" encoding="UTF-8"?>
<a>
<?xml version="1.0" encoding="UTF-8"?>
<b>
hello
</b>
</a>
I believe it is not, however I can't find a source to back me up on this.
From Extensible Markup Language (XML) 1.0
Definition: XML documents SHOULD begin with an XML declaration which specifies the version of XML being used.
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.
The document type declaration MUST appear before the first element in the document.
This is close, but it doesn't talk about the XML declaration itself, even though it should come before it.