Don't produce invalid html with html_attrs

The html_attrs method produces the attributes xmlns, xml:lang and lang.
Of these only lang is valid in HTML 4, and the other two are unnecessary
in HTML 5.

Change html_attrs to only produce xmlns and xml:lang elements if the
format is xhtml.