The solution that lemppari gave COMPLETELY solved the issue for me.
I can't thank you all enough for this - the "never-ending temp file problem" in itunes has been bugging me for a REALLY long time.
You guys ROCK.
Everyone on this thread, just wanted to thank you all. I'm a fundamentally lazy person, and only upgraded to Lion last week. Given that I have a ~1Tb iTunes collection and had time machine turned on, I guess it was inevitable that I'd have the issue you've all been discussing. After reading through this thread, I turned time machine off, and permissions are restored to my iTunes library.
I do have one question -- does anyone know why the iTunes Music Library.xml file shows up as a MS Entourage doc? I have office installed on my mac so Entourage is here somewhere, but I never use it. I guess if it doesn't matter, I don't care...
Anyway, thanks again
mjaname - Just to be clear, you don't need to totally turn off Time Machine to fix this. You only need to disable the 'local snapshot' feature (refer here if you need a description of 'local snapshots' - http://support.apple.com/kb/HT4878). You can do this through Cocktail or using Terminal as described a bit earlier in this thread.
On your question of MS Entourage, when installed it associated all XML files types to this program. You can (and I would suggest) changing this association. Easiest way would be to go to your iTunes Music Library.xml file and select 'Get Info'. About mid-way down the panel you will see an 'Open with:' where you'll find a pull down to select another program like TextEdit. You can also change this as the default application for all the XML documents by selecting the 'Change All..' button below - which I would personally recommend.
Exactly this problem led me here. It was only after I updated to M. Lion (I skipped Lion). iTunes is exhibiting the issue where it is creating .tmp files, can't find it's library, and works again if I correct permisions with Disk Utility.
Meanwhile, the DJ program Scratch Live, is unable to access the Itunes library (unless I've done the permissions thing again.) Crazy-making.
I'll be watching to see if turning off Time Machine's local images works. It is a shame, since using the local images feature was a good one for me since I can't always have my laptop connected to back it up. Sigh.
I was tearing my hair out with this until I finally found this thread (and kept reading). Turning off local snapshops on Time Machine worked perfectly!!! Thank you whoever figured this out originally.
Now if I could only figure out how to stop iTunes from opening up all the time after I closed it...