Document constructor and getDocument