XML::Simple Parsing with Attributes problem



Hi - problem parsing with an attribute name.

<england>
<town code="LON">Capital City</town>
<town code="MAN">Manchester</town>
<town code="BHAM">Birmingham</town>
</england>

I'm using XML::Simple.

$xml = new XML::Simple (ForceArray=>1, suppressempty=>1);
$data = $xml->XMLin($xmlfile);

$which=$data->{england}->[0]->{town}->[0]; doesn't work.

I need to access both attribute value and its contents (BHAM and
Birmingham).

Any ideas?

John



.