SimpleXMLElement::__construct():实体:第1行:解析器错误:期望开始标记,'<&#


SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found

下面的代码(使用CodeIgniter 3.0)给出这个错误,我不明白为什么:

SimpleXMLElement::__construct():实体:第1行:解析器错误:期望开始标记,'<'未找到

<?php
require_once './pdfGenerator.php';
require_once './pdfWrapper.php';
require_once './tcpdf_ext.php';
$debug = false;
$error_handler = set_error_handler("PDFErrorHandler");
if (get_magic_quotes_gpc()) {
    $xmlString = stripslashes($_POST['mycoolxmlbody']);
} else {
    $xmlString = $_POST['mycoolxmlbody'];
}
//where the problem
if ($debug == true) {
    error_log($xmlString, 3, 'debug_'.date("Y_m_d__H_i_s").'.xml');
}
$xml = new SimpleXMLElement($xmlString, LIBXML_NOCDATA);
$scPDF = new schedulerPDF();
$scPDF->printScheduler($xml);
function PDFErrorHandler ($errno, $errstr, $errfile, $errline) {
    global $xmlString;
    if ($errno < 1024) {
        echo $errstr."<br>";
        error_log($xmlString, 3, 'error_report_'.date("Y_m_d__H_i_s").'.xml');
        exit(1);
    }
}

use

$xml = simplexml_load_string($xmlString,'SimpleXMLElement', LIBXML_NOCDATA);
不是

$xml = new SimpleXMLElement($xmlString,LIBXML_NOCDATA);