I'm almost done with my studio program and need to finish implementing the recent documents feature.

I already have a functin that pulls the data from an XML file and I'm pretty positive I can easily finish the part that adds an entry to the XML file. My true problem is when I run my query function, how can I only pull the last 5 results?

XML: RecentDocuments.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<FXStudio>
	<RecentProjects>
		<Project name="Document Title">FilePath</Project>
	</RecentProjects>
</FXStudio>
Basically this is what I'm trying todo:
Code:
<?xml version="1.0" encoding="utf-8"?>
<FXStudio>
	<RecentProjects>
		<Project name="Document Title1">FilePath1</Project>
		<Project name="Document Title2">FilePath2</Project>
		<Project name="Document Title3">FilePath3</Project>
		<Project name="Document Title4">FilePath4</Project>
		<Project name="Document Title5">FilePath5</Project>
		<Project name="Document Title6">FilePath6</Project>
	</RecentProjects>
</FXStudio>
And the outputed entries:
Document Title 6
Document Title 5
Document Title 4
Document Title 3
Document Title 2

Thanks.