diff --git a/We.php b/We.php
index a9a5efa..6523ec3 100644
--- a/We.php
+++ b/We.php
@@ -86,7 +86,7 @@ class We
      * 定义当前版本
      * @var string
      */
-    const VERSION = '1.2.20';
+    const VERSION = '1.2.21';
 
     /**
      * 静态配置
diff --git a/WeChat/Contracts/Tools.php b/WeChat/Contracts/Tools.php
index 60a435d..007bc3d 100644
--- a/WeChat/Contracts/Tools.php
+++ b/WeChat/Contracts/Tools.php
@@ -164,6 +164,21 @@ class Tools
         return json_decode(json_encode($data), true);
     }
 
+    /**
+     * 解析XML文本内容
+     * @param string $xml
+     * @return boolean|mixed
+     */
+    public static function xml3arr($xml)
+    {
+        $parser = xml_parser_create();
+        if (!xml_parse($parser, $xml, true)) {
+            xml_parser_free($parser);
+            return false;
+        }
+        return json_decode(json_encode(simplexml_load_string($xml)), true);
+    }
+
     /**
      * 数组转xml内容
      * @param array $data
diff --git a/WePay/Bill.php b/WePay/Bill.php
index 4c853c7..602fbc7 100644
--- a/WePay/Bill.php
+++ b/WePay/Bill.php
@@ -39,7 +39,7 @@ class Bill extends BasicWePay
         $params = $this->params->merge($options);
         $params['sign'] = $this->getPaySign($params, 'MD5');
         $result = Tools::post('https://api.mch.weixin.qq.com/pay/downloadbill', Tools::arr2xml($params));
-        if (($jsonData = Tools::xml2arr($result))) {
+        if (is_array($jsonData = Tools::xml3arr($result))) {
             if ($jsonData['return_code'] !== 'SUCCESS') {
                 throw new InvalidResponseException($jsonData['return_msg'], '0');
             }
diff --git a/composer.json b/composer.json
index d21c7f0..b0c41e3 100644
--- a/composer.json
+++ b/composer.json
@@ -21,6 +21,7 @@
   ],
   "require": {
     "php": ">=5.4",
+    "ext-xml": "*",
     "ext-json": "*",
     "ext-curl": "*",
     "ext-bcmath": "*",