Error [64]: document type does not allow element X here
I got this error when I accidentally placed a <script> tag after
the head, but before the body, and the validator complained
about the body tag not being allowed here. After some trial
and error, I realized that the script was at fault and that
everything validated fine once the script was moved into the
head.
The validator didn't complain at all about the misplaced script
though (perhaps because <script> implicitly starts a <head>?),
so it might be helpful to include a note about items in between
head and body possibly causing this error.