For Ubuntu:
sudo apt-get install php7.0-xml
For Fedora:
yum -y install php-xml
This extension is enabled by default. It may be disabled by using the following option at compile time: --disable-dom
For Ubuntu:
sudo apt-get install php7.0-xml
For Fedora:
yum -y install php-xml