In you care about the order of those elements XML::Simple (or indeed any similar XML-to-hashref tool) is not your friend. Perl hashes do not preserve order. There are modules that give you order-preserving hashes (via ties) but persuading XML::Simple to use them is probably not possible.

It worked on my machine, but Text::CSV's behaviour can be a little variable - it has two underlying implementations: one in pure Perl, and a faster one in C. Which one you get is the luck of the draw. In this case, $row is a blessed arrayref; Text::CSV expects an arrayref; it looks like one of the implementations rejects the arrayref if it's blessed but the other does not.