Add new method initFromDomDocument + PHPUnit test