From html generates an imitation document as it would be parsed in the browser