#!/usr/bin/perl

use strict;
use warnings;
use XML::RAI;
use HTML::Entities;
use Encode;

my $xml = do { local $/; <DATA> };

my $r = XML::RAI->parse( $xml );

foreach ( @{$r->items} ) {
  my $t = $_->title;
  print "$t\n";

  $t = decode_entities($t);
  $t = &HTML::Entities::encode_entities($t);
  print "$t\n";
}

#<title>The Modern R&amp;eacute;sum&amp;eacute;</title> 
__DATA__
<?xml version="1.0" ?>
	<rss version="0.91">
	<channel>
		<title>Smartmoney.com - Consumer Action</title> 
		<link>http://www.smartmoney.com/consumer/?nav=RSS091</link> 
		<description>Investing, Saving and Personal Finance</description> 
		<language>en-us</language> 
		<copyright>Copyright 2004 Smartmoney.com, joint venture of Dow Jones &amp; Co. and Hearst Communications, Inc.</copyright> 
		
		
		<item>

<title>The Modern R&amp;eacute;sum&amp;eacute;</title> 
			<link>http://www.smartmoney.com/consumer/index.cfm?story=20040505&amp;nav=RSS091</link>
			<description>R&amp;eacute;sum&amp;eacute;s that worked even a few years ago aren&apos;t effective today. Here are five essential updates.</description>
		</item>
		
		
	</channel> 
	</rss> 
	
	
	
	
	
	
	
	
		
		
		
		
		
			
			
				
				
			
		
	

