Exporting Apple Music Data to .xml File fails every time

I am trying to export my Apple Music data to a .xml file but I get a message saying "We can't open the document Library.xml because we found a problem with its contents. No error detail available. Location: Line 2, Column:9"


That's all there is! So because I can't open it, I can't correct it!... a lot of Mac users have had the same issue over a 3-year period but there has never been answer. Any ideas out there?

MacBook Pro (M1 Pro, 2021)

Posted on Dec 5, 2025 7:44 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 5, 2025 1:13 PM

Might be worth rebooting the computer, then holding down option+cmd as you launch Music which appears to perform some unspecified housekeeping on the database, before generating a fresh XML file. Do you have any third party security software that might impact file opening tasks? It may be that the file is still locked when you try to access it via that right-click menu. TextEdit might be the most appropriate default app for an XML file. BBEdit is also very useful for inspecting large text files, and can be used for free, with some limitations, after a trial. You would likely not need the paid features.


tt2

6 replies
Question marked as Top-ranking reply

Dec 5, 2025 1:13 PM in response to Dgriffit

Might be worth rebooting the computer, then holding down option+cmd as you launch Music which appears to perform some unspecified housekeeping on the database, before generating a fresh XML file. Do you have any third party security software that might impact file opening tasks? It may be that the file is still locked when you try to access it via that right-click menu. TextEdit might be the most appropriate default app for an XML file. BBEdit is also very useful for inspecting large text files, and can be used for free, with some limitations, after a trial. You would likely not need the paid features.


tt2

Dec 5, 2025 8:55 AM in response to Dgriffit

What version of macOS are you running?


What application are you trying to open the XML file in? It should be a structured text file that can be opened in a variety of text editors. It can potentially be imported back into Music at a later date to rebuild playlists, for example, provided all of the items referenced in it are still at the same paths. Typically the XML file is only needed for third party apps that want to know what is in the Music library and cannot access it directly. It shouldn't be used to migrate a library to a new computer.


tt2

Dec 5, 2025 10:27 AM in response to turingtest2

Thank you for the reply. I marked it as “unhelpful” only because I should have said what I was trying to do. So my error. I have MacOS Tahoe 26.1 and in ITunes I used to be able to export a catalogue of my albums and artists so I could see my whole collection. I assumed that the “Export” function was the same as the ITunes function. I simply used the “open with…” choice.


So if anyone knows how I can get my Catalogue I would be grateful…

Dec 5, 2025 1:01 PM in response to turingtest2

OK… As I said, I was using the “Open with …” command as double-clicking a file, in this case the Library.xml file, would normally open whatever default Application opens that file. However, all I got was a system popup message that clearly said the file can not be opened because of an undetailed error in Line 2, Column 9. I’m guessing that message would preclude its being opened by any Application?


I’m also afraid that the “Open with…” command gave me very few choices of App to use anyway; Excel, Word, Text… and that’s where I gave up and asked the forum.


Going back 3 years, many other users have had exactly the same message

Exporting Apple Music Data to .xml File fails every time

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.