#!/usr/bin/perl use warnings; use strict; use Data::Dumper; use XML::Parser; my $xml =<<"DONE"; Tom 111-1234 Dear Sir: DONE my $parser = new XML::Parser( Style => 'Tree', ErrorContext => 2 ); my $tree = $parser->parse( $xml ); print( Data::Dumper->Dump( [ $tree ] ) );