#71394GeneralUtility::array2xml(): Empty arrays are encoded as whitespace
Description
When encoding an empty array as XML (e.g. an empty Flexform container from which all sections have been removed), the empty array will be encoded as (linebreaks stripped) <el index="el"> </el>. This leads to the object not being treated as an empty array on decoding, but as a nonempty string.
In some situations, such a non-empty string leads to undesirable results, e.g. when passing it to Fluid’s f:for view helper, where it will trigger a warning because it is not iterable.
The root cause can be found in GeneralUtility::array2xml(), where the value of array elements is prepended with indentation no matter the size of the array. Instead, empty elements should be dropped.
In most situations, the type="array" will mitigate the negative effects. For certain Flexform constellations however, this will not be used, making it impossible to resolve the type properly.