my $xsd_file = XML::LibXML::Schema->new(location => $xsd); my $parser = XML::LibXML->new; my $XML_file = $parser->parse_file($xml); eval { $schema->validate(XML_file) };