You need to install the DOM extension to fix the error. Run one of the following commands to install the DOM extension.
sudo apt-get install php7.0-xml
sudo apt-get install php7.1-xml
sudo apt-get install php7.2-xml
If you are not sure what version you should select, run sudo apt-get install php-dom to find what you needs to install.
Here is the output of 'sudo apt-get install php-dom'
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php-dom is a virtual package provided by:
You should explicitly select one to install.