note
tobyink
<p>What is your full code? What output do you get? What do you expect?</p>
<p>Unless you tell us that, we can't figure out where you're going wrong.</p>
<p>Here's the code for an example I created:</p>
<c>
use strict;
my $str = q{<seg><foo mid="0" mtype="seg"><g id="1">Need to export this text</g></foo></seg>};
my $xml = XML::LibXML->load_xml(string => $str);
print $xml->getElementsByTagName("g")->shift->toString, "\n";
</c>
<p>The output is:</p>
<c>
<g id="1">Need to export this text</g>
</c>
<p>Which is exactly what I'd expect it to be.</p>
<p>What is <em>your</em> full code? What output do <em>you</em> get? What do <em>you</em> expect?</p>
<div class="pmsig"><div class="pmsig-757127">
<small><a href="http://toby.ink/">toby döt ink</a></small>
</div></div>
1218873
1218892