diff --git a/src/ArrayToXml.php b/src/ArrayToXml.php index 8eba571..4a0a457 100644 --- a/src/ArrayToXml.php +++ b/src/ArrayToXml.php @@ -241,7 +241,7 @@ protected function isArrayAllKeySequential($value) protected function addAttributes(DOMElement $element, array $data) { foreach ($data as $attrKey => $attrVal) { - $element->setAttribute($attrKey, $attrVal); + $element->setAttribute($attrKey, $attrVal ?? ''); } }