my $doc = XML::LibXML->load_xml(location => '1.xml'); my $root = $doc->documentElement; my $nsuri = $root->namespaceURI;