in reply to xml sorting using XML::Twig

A typo? You probably have:
$t->parse( \*DATA);

In the XML::Twig docs, sort_children seems to need arguments passed to it.