use strict; use warnings; use XML::Simple; use LWP::UserAgent; use Data::Dumper; my $ua = new LWP::UserAgent; my $response = $ua->get('http://server/path/to.xml'); die "couldn't fetch xml\n" unless $response && $response->is_success; my $xmlString = $response->content; my @options = (); # put parser options in here. my $ref = XMLin($xmlString, @options); print Dumper($ref);