I agree with Ralph. Your question is not question at all. You have a template that includes different files to output a web page with a session started… but implementing DOM? The DOM is created each time you load a page. It is the nodes and structure resulting from the interpretation of your markup by your browser.
It’s not likely that the doctype you choose will have any bearing on the code you posted above. Use whatever suits you, but preferably a strict doctype or the generic <!DOCTYPE html>. The important thing is to have a doctype.