This is considered so evil, but would be useful if you have existent software/library that uses XML::LibXML inside and change the behaviour globally to use Liberal parser instead, with a single method call.

For example, the following code lets XML::Atom's parser use Liberal LibXML parser.

use URI;
use XML::Atom::Feed;
use XML::Liberal;
XML::Liberal->globally_override('LibXML');
# XML::Atom calls XML::LibXML->new, which is aliased to Liberal now
my $feed = XML::Atom::Feed->new(URI->new('http://example.com/atom.xml'));

If you want the original XML::LibXML->new back in business, you can call globally_unoverride method.