http://qs321.pair.com?node_id=1218875


in reply to get text from node - XML::LibXML

Here is an SSCCE:

use strict; use warnings; use XML::LibXML; use Test::More tests => 1; my $in = '<seg><foo mid="0" mtype="seg"><g id="1">Need to export this +text</g></foo></seg>'; my $want = '<g id="1">Need to export this text</g>'; my $xml = XML::LibXML->load_xml (string => $in); my $have = $xml->getElementsByTagName ('g')->shift->toString; is ($have, $want);