is there an option with DomDocument to remove the first line:
The class instantiation auto
You can use output buffering to remove it. A bit of a hack but it works.
ob_start(); // dom stuff $output = ob_get_contents(); ob_end_clean(); $clean = preg_replace("/(.+?\n)/","",$output);