src/thinkextend/transform/driver/Xml.php
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;
    }
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;
    }
解码XML数据
@param  string  $str    XML字符串
@param  boolean $assoc  是否转换为数组
@param  array   $config 数据配置项
@return string          解码后的XML数据