Further, a database is an excellent tool if you need to make complicated queries, especially if they will vary from time to time. Databases build indexes, and are optimized for keeping the indexes up to date with a constantly changing data set. Relational databases also have many other advantages, including a rich query language, mature authoring and schema design tools, proven scalability, fine-grained access control, and so on. Finally, it's entirely possible to provide a wrapper for your database that makes SQL queries and translates them into XML streams, so you could have it both ways. XML becomes a more robust, programmer-friendly frontend to a mature database for storing and searching.
People love showing pictures of themselves, their friends, their pets, and their vacations.
While a full-fledged photo album site would require a complicated object model, I'll focus on defining a single Picture object. The object representing a picture needs fields representing its title, the date it was taken, an optional caption, and, obviously, a pointer to the image source. Finally, let's extend the picture record with an element defining a set of thumbnail images for use in the table of contents or elsewhere. Here I use the same concept of image I defined earlier.