Example text:
Some text here which may be any length and contain a number of child tags.
####
use XML::Twig;
my $twig = new XML::Twig(TwigHandlers => { 'bold' => \&bold, 'p' => \¶graph, 'li' => \&ordered_list},TwigRoots => {body => 1});
sub bold {
my ($twig, $bold,) = @_;
my $bold_text = $bold->text;
&choiceReplace($bold_text,$file);
$bold->set_text($bold_text);
}
sub paragraph {
my ($twig, $para,) = @_;
my $para_text = $para->text;
&choiceReplace($para_text,$file);
$bold->set_text($bold_text);
}