Make sure generate wont fail is the value is an array
Merge pull request #1868 from DeuxHuitHuit/XMLElement

If `XMLElement->setValue` is passed an array, implode it instead of crashing