Best way to learn as in learn to the highest standards from the off.
The one you have allows for mistakes.
1 tells user agents it is a HTML document.
2. As it is a XHTML document it needs a namespace which is what the xmls attribute is.Now the namespce is a way of telling humans more about the code in the document check out XHTML namespace which is what it links to for more info.