
One of the files that iPhoto keeps inside its library folder is a file named "AlbumData.xml". This file is written out by iPhoto so that other applications, such as iMovie and iTunes, can read it and tell what photos and albums are in your photo library. iPhoto Library Manager also reads this file in order to display what albums are in your photo library.
The AlbumData.xml file is only written out by iPhoto, it is never read back in, so you cannot modify it as a way of changing information in your library. In fact, the next time iPhoto writes out the file, it will wipe out any changes that have been made.
There are some instances where iPhoto will write out malformed data to the AlbumData.xml file, causing other applications to be unable to read the file correctly. This will result in iPhoto Library Manager displaying an error message reading ""The album data file for this library is malformed" (with some additional details) in the list where the library's albums are usually displayed. Other applications such as iMovie and iWeb, in their interface for accessing iPhoto's files, will typically display a message such as "Launch iPhoto 2 or later to populate this list."
The most common cause of a malformed AlbumData.xml is the presence of an ampersand (&) character somewhere in the path of the iPhoto library folder. This can include the name of any folder that contains the library or the name of the disk that the library is on. If this is the case, first quit iPhoto, then go rename the folder or disk to remove the ampersand character. When you switch back to iPhoto Library Manager, it will detect the renaming and the path in the Location field on the right will update. You will then have to open up the library in iPhoto, change something in the library (such as adding a new album), and close it again to get iPhoto to write out the file again with the new, non-problematic path.
Another comon cause is the presence of an invisible "null" character in one or more of your keywords. When you import photos into iPhoto, the photo files can sometimes have keywords embedded in their metadata, which iPhoto will dutifully read from the files and assign to the photos. However, the embedded keywords can sometimes have this additional "null" character at the end. The character is invisible, making it hard to tell whether it's there or not, but iPhoto does not handle it properly and will write out a corrupt album data file if it is there. If you look at your list of keywords in iPhoto's preferences window and see some keywords that you didn't add yourself, it's possible that iPhoto copied them there from some of the photos you imported. If you don't need the keywords at all, the easiest thing to do is just delete them. If you do want to keep a keyword around, then double click on its name and retype it completely from scratch - that will effectively eliminate any invisible character that might be messing things up.
Advanced Troubleshooting
If you want to try to find the item in your library that is causing the problem, follow these steps as a general guide:
If you see a line reading "<key>List of Keywords</key>" not too far up from your position in the file, then the problem is with one of your keywords. A correct keyword will usually look like "<string>Vacation</string>", where as a corrupt keyword will be missing the end tag, and look like "<string>Vacation" followed by some whitespace. Once you've found the offending keyword, you can deal with it using the methods described above. Note: editing the AlbumData.xml file will not fix the problem permanently - you must open the library itself in iPhoto and deal with the problem there.
If the problem is located in a record for a particular photos (you should see lines for properties such as "MediaType", "Caption", "Comment", etc.), then you can either go to that photo in your library and try to edit the photo's information, or you can just remove that photo from your library altogether and re-add it later. Finding the photo can sometimes be tricky, especially if the bad data prevent's the photo's title or filename from being written out to the file.
Another recently introduced problem, which appears to only happen with iPhoto 8.1, has to do with music that you've assigned to a custom slideshow. If you have created a slideshow in iPhoto, and using the "Settings" button, have assigned a song from your iTunes library to be played with that slideshow, then if that song has an ampersand (&) character anywhere in the path to the music file (this can include the name of the artist, the album, or the song itself), iPhoto does not write it out correctly to the XML file and you get an error. If you do have a music file assigned to a slideshow, you will either need to assign a different song, or remove any ampersands in the path to the song and re-select the same song in iPhoto to update it to the new location. (make sure to click "Apply" in the settings window to make your change "stick").
If you have any problems finding the error on your own, feel free to send a copy of your AlbumData.xml to $supportlink$ to get further assistance.