fold_arrays (XmlSimple)

    # File lib/xmlsimple.rb, line 540
      def fold_arrays(hash)
        fold_amount = 0
        keyattr = @options['keyattr']
        if (keyattr.instance_of?(Array) || keyattr.instance_of?(Hash))
          hash.each { |key, value|
            if value.instance_of?(Array)
              if keyattr.instance_of?(Array)
                hash[key] = fold_array(value)
              else
                hash[key] = fold_array_by_name(key, value)
              end
              fold_amount += 1
            end
          }
        end
        fold_amount
      end