title: In XML, what's the difference between an "element", "tag", "type" and "name"
body: <p>I'll say right at the start that this question is a bit pedantic, but I want to make sure I'm using the technical language accurately when referring to parts of an XML document.</p>
  <p>Given the following,</p>
  <pre><code>&lt;p&gt;&lt;/p&gt;
  </code></pre>
  <p>What should I call the <code>&lt;p&gt;</code>? Is it an &quot;element&quot; or is it a &quot;tag&quot;?</p>
  <p>What should I call the <code>p</code>? Is it a &quot;name&quot; or is it a &quot;type&quot;?</p>
  <p>According to the W3C Recommendation, (<a href="https://www.w3.org/TR/xml/#sec-starttags" rel="nofollow noreferrer"><em>Extensible Markup Language (XML) 1.0 (Fifth Edition), § 3.1</em></a>):</p>
  <blockquote>
  <p><em>The Name in the start- and end-tags gives the element's type.</em></p>
  </blockquote>
  <p>It sounds like <code>element</code> and <code>tag</code> and <code>name</code> and <code>type</code> are used interchangeably. When should I use each?</p>