public static function loadSimpleXML($xml_file, $verify_dtd = true){

		$options = ($verify_dtd ? LIBXML_DTDVALID : null);

		libxml_clear_errors();
		$SimpleXML = @simplexml_load_file($xml_file, null, $options);
		$LibXMLError = libxml_get_last_error();

		if($SimpleXML === false || $LibXMLError instanceof \LibXMLError){

			if($LibXMLError instanceof \LibXMLError){

				$xml_base = basename($LibXMLError->file);

				throw new XMLException("{$LibXMLError->message} in $xml_base
					on line {$LibXMLError->line}");
			}

			else{

				$xml_base = basename($xml_file);

				throw new XMLException("SimpleXML failed to load $xml_base,
					unknown error");
			}
		}

		return $SimpleXML;
	}