ob_start();
$html = curl_init('http://www.beijing.gov.cn/');
curl_exec($html);
$html = iconv('GBK','UTF-8',$html);
$config = array('indent' => TRUE,
'output-xhtml' => TRUE,
'wrap' => 200);
$tidy = tidy_parse_string($html,$config,'UTF8');
$tidy->cleanRepair();
$tidyhtml = (string)$tidy;
$xml = simplexml_load_string($tidyhtml);
echo $tidyhtml;
var_dump($xml);