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.
We need to know exactly which problem you have
Before asking, do a search... if you don't find the answer, then ask The purpose of this forum is to help others in the community, that's why it's called Sitepoint and not Linkpoint. SP Guidelines - No fluff.
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.