$state = $doc->toFile($filename, $format); $doc = $parser->parse_file( $xmlfilename );