for my $p ($xhtml->findnodes('//blockquote/p')) {
my $text = $p->as_text();
$text =~ s/^\s+//;
$text =~ s/\s+$//;
if ( $text =~/\n\s*\n\s*/ ) {
my @paragraphs = split(/\s*\n\s*/, $text);
my @new_elems;
for my $para (@paragraphs) {
my $new = HTML::Element->new('p');
$new->push_content($para);
push(@new_elems, $new);
}
$p->replace_with(@new_elems);
}
}