Looks good 🙂
I'd suggest the following to make sure that the scripts work with or without domxml (or any other extension loaded with dl in your scripts).
Example for domxml.so:
if (!function_exists('domxml_open_file')) {
dl('domxml.so');
}
The extension still needs to be available in some way. But with the code above you don't hav to care about if the (existing) extension has been in php.ini or not. Check the manual ... there are some examples (the code above lacks Windows support and dl doesn't work in all cases).
About the 'Call to a member function on a non-object' error:
I think domxml_open_file couldn't open the file or parse the file.
There are some examples here
Besides that if you want to loop through all child elements you first need to get e.g. the root node with
$docroot = $domdoc->document_element();
Check the domxml section of the manual
There are some examples (check the user contributed notes, too).
Thomas