in reply to Re: set attributes to an element in user defined order
in thread set attributes to an element in user defined order

You've fallen into a trap. Read the post again. It tries to use the keep_atts_order option of XML::Twig, and the whole purpose of that option is to be able to output the attributes in a particular order.