in reply to How to access results of XML::Simple?

Other than what other monks pointed out, I believe a big question mark you had was why the root element, in this case the 'gene', was not in the hash.

The answer is that the default style of XML::Simple is not to keep root element, if you want see the root, do this:
use XML::Simple; use Data::Dumper; use strict; use warnings; my $data = do {local $/;<DATA>}; my $xml = new XML::Simple(keeproot => 1);# this is what you want my $tree = $xml->XMLin($data); print Dumper($tree); __DATA__ <?xml version="1.0" ?> <gene id = "3" label = "gene_of_interest" />