The class 'DomDocument' is apart of the DOM extension. Per the documentation:
This extension is enabled by default. It may be disabled by using the following option at compile time: --disable-dom
Remove the --disable-dom
flag from your configure script and the extension should be available.