A lost iTunes library due to accidental deletion can be restored as long as the iTunes library XML file remains in your iTunes music folder. The XML file retains your music library’s information, including play count, playlists and ratings. The XML file can be copied to your desktop and back to your iTunes folder to rebuild your library and playlists without any data loss. For PCs, open Windows Explorer, and go to “Documents and Settings/(user name)/My Documents/My Music. Double-click the “iTunes” folder and drag iTunes Music Library.xml to your desktop or into your Documents folder.

How to Restore an iTunes Library With an XML File - 28