#totally untested! sub att_to_children { my( $elt)= @_; foreach my $att ($elt->att_names) { $elt->insert_new_elt( last_child => $att, $elt->att); } $elt->del_atts; }