title: How to validate xml using python without third-party libs?
body: <p>I have some xml pieces like this:</p>
  
  <pre><code>&lt;!DOCTYPE mensaje SYSTEM "record.dtd"&gt;
  &lt;record&gt;
      &lt;player_birthday&gt;1979-09-23&lt;/player_birthday&gt;
      &lt;player_name&gt;Orene Ai'i&lt;/player_name&gt;
      &lt;player_team&gt;Blues&lt;/player_team&gt;
      &lt;player_id&gt;453&lt;/player_id&gt;
      &lt;player_height&gt;170&lt;/player_height&gt;
      &lt;player_position&gt;F&amp;W&lt;/player_position&gt;   &lt;---- a '&amp;' here.
      &lt;player_weight&gt;75&lt;/player_weight&gt;
  &lt;/record&gt;
  </code></pre>
  
  <p>Is there any way to validate whether the xml pieces is well-formatted? 
  Is there any way to validate the xml against a DTD or XML Scheme?</p>
  
  <p>For various reasons <strong>I can't use any third-party packages.</strong></p>
  
  <p>e.g. the xml above is not conrrect since it has a '&amp;' in it. Note that the DOCTYPE definition sentence refer to a DTD.</p>