Emerson, valeu pelo post... ajudou muito.
Devy++, tive o mesmo problema e resolvi assim:
public function __construct($ofxFile) {
$this->ofxFile = $this->closeTags($ofxFile);
}
public function closeTags($ofx=null) {
$buffer = '';
$source = fopen($ofx, 'r') or die("Unable to open file!");
while(!feof($source)) {
$line = trim(fgets($source));
if ($line === '') continue;
if (substr($line, -1, 1) !== '>') {
list($tag) = explode('>', $line, 2);
$line .= '</' . substr($tag, 1) . '>';
}
$buffer .= $line ."\n";
}
$name = realpath(dirname($ofx)) . '/' . date('Ymd') . '.ofx';
$file = fopen($name, "w") or die("Unable to open file!");
fwrite($file, $buffer);
fclose($file);
return $name;
}