Generally sub-classing is the way to go, but sub-classing HTML::Element can be pretty ugly, so not such an easy decision in this case.
If you aren't opposed to dirty little hacks, you could modify the attribute names you make to take advantage of the "sort keys" used in the starttag sub to order the attributes.
e.g. instead of
$m_el->attr('name',$m);
$m_el->attr('content',$meta{$m});
you write
$m_el->attr('aa01_name',$m);
$m_el->attr('aa02_content',$meta{$m});
Then you just post process $out to substitue in the real attribute names. e.g. $out =~ s/aa01_name/name/g
I only feel a little dirty ;)