in reply to XML data structures and XML::Simple

First, there are some issues with that code. You declare (using 'my') $xml twice. In this particular example you can comment out the first one since you don't use the OO version of XMLin anyway.

Anyway, the answer to your question is in the output from Data::Dumper.

print $xml->{gene}{$id}{gene_seq}{'startpos'}, "\n";

If you wanted the keeproot option you could supply it directly to XMLin like this:

my $xml = XMLin($data, keeproot => 1);

But that would require the print statement to change to:

print $xml->{many_genes}{gene}{$id}{gene_seq}{'startpos'}, "\n";

-- 
dempa