in reply to non-greedy piecewise matching
You have to use '.+?' instead of '.+' to make non-greediness. Take a look at perlre.
As you said, if .xml is present after each records, then we can also use substitution or split function.
$file =~ s/(\.xml)/$1\n/g;
An organised event
A traditional gathering
With family and friends
I don't celebrate the New Year
Adjusting my clocks for the Leap Second
I can't remember
Results (238 votes). Check out past polls.