Can someone please tell me why kindlegen can't handle <pre>?

I have some html:

<pre class="literal-block">
$ python

And kindlegen kindly gives me this?

  <div align="left">
      <br/>$ python<br/>

Calibre on the other hand seems a little more pleasant::

<blockquote height="1em" width="0pt">
    <br></br>$ python<br></br>

I thought well formed XML was a solved problem. The internet abounds with people claiming that one should only use kindlegen. The hacker in me sees a new rst translater, the realist in me cringes.