If you're asking how to access the data structure returned by XML::Simple, that entirely depends on the structure of your XML. There is nothing wrong with the code that you've listed above, but if you're wanting to know why $ref->{$_} isn't listing deeper contents, maybe it's because it's a more complex data structure than just a scalar?
If so, just use Data::Dumper to output it or use ref to determine what type it is and use recursion:
foreach (keys %{$ref}) {
print $_." ".Dumper($ref->{$_})."\n";
}
Note, there are parameters that you can pass to XMLin to adjust the way that it creates the data structure from the source XML. Just read the cpan docs for more details.