my $doc = XML::LibXML->new()->parse_file('stsdef.xml'); my $rng = new XML::LibXML::RelaxNG(location => 'stsdef.rng'); $rng->validate($doc);