use XML::XPath; use XML::XPath::XMLParser; my $xp = XML::XPath->new(filename => 'test.xhtml'); my $nodeset = $xp->find('/noticias/noticia'); foreach my $noticia ($nodeset->get_nodelist) { my ($title,$fulltext,$date,$time) = ( $noticia->find('titulo')->string_value, $noticia->find('texto')->string_value, $noticia->find('fecha')->string_value, $noticia->find('hora')->string_value ) }