your comment was exactly what I was hoping for. I'll play with the keyattr to avoid the loop.
In reply to thank you! by waxmop in thread best way to change xml record using XML::Simple? by waxmop