title: Well formed XML? XML references within tag names and attribute names
body: <p>I have been searching trying to confirm my reading of the XML spec.  My interpretation is that pre-defined entities and numeric character references are not allowed in tag names and attribute names, for example this is not allowed by the XML 1.0 spec.:</p>
  
  <pre><code>&lt;root&gt;
  &lt;test&amp;apos;&amp;#x27;&amp;#39;tag test&amp;apos;&amp;#x27;&amp;#39;attribute="one"/&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>However, I have one parser that returns <strong><code>test'''tag</code></strong> for the tag name and <strong><code>test'''attribute</code></strong> for the attribute name while another parser returns <strong><code>test&amp;apos;&amp;#x27;&amp;#39;tag</code></strong> for the tag name and <strong><code>test&amp;apos;&amp;#x27;&amp;#39;attribute</code></strong> for the attribute name.</p>
  
  <p>Which parser is correct? Or are they both wrong (i.e. they should throw a well formed error)?</p>
  
  <p>Thanks!</p>