I think XML::Smart works like this (except that the variable is not readonly).
Updated:fixed the link
In reply to Re: tie and magic by mirod in thread tie and magic by pajout