+ unless (defined *{"${pkg}::"} && $pkg->can('handle_input')) {
+ dbg("xml sentence $rootname not recognised, IGNORED") if isdbg('chanerr');
+ return;
+ }
+
+ my $xref;
+ unless ($xref = $pkg->decode_xml($dxchan, $line)) {
+ dbg("invalid XML ($@), IGNORED") if isdbg('chanerr');
+ undef $@;
+ return;
+ }
+
+ # mark the handle as accepting xml (but only if they
+ # have at least one right)
+ $dxchan->handle_xml(1);
+
+ $xref = bless $xref, $pkg;
+ $xref->{'-xml'} = $line;
+ $xref->handle_input($dxchan);