package example; use XML::LibXML; use strict; use warnings; my $xmlFilePath = ; my $xsdFilePath = ; my $document = XML::LibXML->load_xml( location => $xmlFilePath ); my $schema = XML::LibXML::Schema->new( location => $xsdFilePath ); $schema->validate( $document );