public function decode($str, $assoc = true, array $config = [])
{
//初始化配置
$config = array_merge($this->config, $config);
//创建XML对象
$xml = new \SimpleXMLElement($str);
if ($assoc) {
self::xml2data($xml, $data, $config['item_name'], $config['item_key']);
return $data;
}
return $xml;
}