Today I received the error message:

PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found

And the easy fix on Ubuntu was to install 'php-xml' by running:

sudo apt-get install php-xml

That fixed it. 

If you're running PHP on a web server, you might have to reload your web server configuration.