I am not using XMLin for anything. What I am trying to do (generate an XML file from a hash/hashref of my own making) has been done elsewhere with no problems. It is just that I am being picky about what is an attribute and what is not that is tripping me up.
I forgot to mention an important point: in the $userref hashref, there will be many values for 'name', and they could start with a number, which is why I want to use them as attributes, and not as keys.
Okay, that is very interesting, and it does give you more control, granted. but i want a more on-the-fly approach, which sauoq's solution grants me. i'm not saying you can't do that with XML::Rules of course (i'm sure you can), but his simple edit to my hashref manipulation was easy and ideal and I got to keep XML::Simple and its simple ways. thanks!