The page seems to be fundamentally broken at the HTML level:
Not quite. It passes HTML validation, which does not guarantee anything,
but it's at least formally correct to the extent that an XML validator
can check. The W3C Markup Validator issues the warning "No Character
encoding declared at document level"; the warning is a useful hint, but
not relevant here, as we are looking at the page as transmitted via HTTP
with headers that specify the encoding.
The real problem appears to be that in the browsing situation of the OP,
the page content is something completely different from what we see.
But regarding the issues you raise:
1) The xml declaration should be the first thing in the file, no
preceding white space, although the validator <
http://validator.w3.org/
unicorn> is perhaps over-picky in this aspect.
It does not give any error message or warning about this issue. The XML
specification says that a document SHOULD begin with an XML declaration.
So it is SHOULD, not SHALL, i.e. not a matter of conformance. Besides,
it is common on web pages to omit the declaration, because it puts some
old versions of IE to Quirks Mode.
2) The link element for css should be inside the head element.
I don't see a link element anywhere on the page. Perhaps we, too, are
looking at different versions? Or do you mean that the style element
should be replaced by a link referring to an external style sheet? That
would be a matter of personal preference.
3) I suspect that in xhtml, script elements are also only permitted
inside the head element.
As you can see e.g. by using Unicorn, which you mentioned, that is not
true. And in this case, the code would fail if moved to the head
element. (It is of course *possible* to modify the script so that it can
placed there. But this is not relevant at all here.)