From an OS9 reference, error -54 is a software lock on a file or a permissions error. (Some of the old codes still apply to OSX although there is no formal list of OSX error codes.
First, try simply restarting your computer.
Try quitting iTunes, then deleting the .xml (not .itl !) version of the library file in the iTunes folder (iTunes will generate a new one).
iTunes: Missing folder or incorrect permissions may prevent authorization - http://support.apple.com/kb/ts1277
Troubleshooting permissions issues in Mac OS X - http://support.apple.com/kb/HT2963