#!/usr/bin/perl -w

use strict;
use XML::Simple;
use IO::File;
use Data::Dumper;

my $xml = '<?xml version="1.0" encoding="ISO-8859-2"?><xml foo="a" foo_a=" a" foo_a_=" a " fooa_="a ">truć</xml>';

my $xml_file = shift @ARGV;

if ($xml_file) {
	my $fh = new IO::File($xml_file) || die "can't open $xml_file: $!";
	$xml = XMLin($fh);
} else {
	$xml = XMLin($xml);
}

print Dumper($xml),"\n";

