If I have a span tag like this:
Hi
SecondLine
And I call this jQuery function:
var ht
You aren't actually using XML, so it makes sense that the serialization doesn't use the XML syntax. See also Ian Hickson's essay about sending XHTML as HTML.
All browsers normalize HTML code while building their DOM tree. So, javascript gains access to already normalized DOM. With all tags properly closed and such.
It doesn't. It just modifies the browser DOM.
It is up to the browser to serialise the DOM to HTML or XHTML as it desires when using innerHTML. Different browsers act differently.