[jQuery] Do something 3 times

[jQuery] Do something 3 times


I am using jquery to parse an xml file. It gets the date, title and
link from a Blogger rss. I have it working but I want it to only do
the loop 3 times so it gets the 3 most recent posts. The way this
would work in regular javascript:
for (i=0;i<=2;i++) {
// do some stuff
}
Here's my code:
$(function() {
$(document).ready(function() {
$.ajax({
type: "GET",
url: "blog/rss.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('item').each(function(){
var date_text = $
(this).find('pubDate').text()
var title_link = $(this).find('link').text()
             var title_text = $(this).find('title').text()
            $('

')
.html('<strong>' + date_text.substr(0,16)
+ '</strong><br /> ' + '<a href=\"' + title_link + '\">' + title_text
+ '</a>' )
.appendTo('#recentposts');
});
}
});
});
});
Thanks