#!/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>
<isis delimiter=" aa ">foo</isis>
<isis>
	<delimiter> aa </delimiter>
	<format>foo</format>
</isis>

<test foo="a" foo_a=" a" foo_a_=" a " fooa_="a ">truć</test>
</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,
		ForceArray => [ 'isis', 'config', 'format' ],
		ForceContent => 1,
		NormaliseSpace => 0,
		KeyAttr => [ 'isis' ]
	);
}

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

