$xmldoc = domxml_open_mem("<?xml version='1.0' encoding='ISO-8859-1'?>".$xml, DOMXML_LOAD_PARSING, $error);