Make sure generate wont fail is the value is an array

I accidentally passed an array to `XMLElement->setValue` and that made generate when checking `strlen($this->_value) != 0`

I just imploded the array, as we do often in Symphony.

I really think having an imploded value is better than a full crash.