There’s an inherent ambiguity with converting XML to a JSON-like structure with regard to knowing which elements should be converted to an array. When there are multiple adjacent elements with the same name, that’s obviously an array. But in the case where there’s only one element with that name, should that be an array with one element, or just an object?
The key to solving this issue is to call the sl.ensureArray function in the Mapper right before the JSON Splitter. Map the path you’re using for the split expression to sl.ensureArray(path). Use that when you know that the path is supposed to represent an array. When the XML has more than one element for that path, the value passed to that function will already be an array, and the function will just return that array without modification. But when the output of the XML parser has a single object at that path, the function will wrap that object in an array and return that. So it will work in both the single- and multiple-element cases, because it ensures that the JSON Splitter will always operate on an array.