Generates DOM from PHP