How your file is read
Every direct child of the root element is read as one track. Inside it, four tags are picked up and the rest is left alone. The root can be named anything you like, and the tags can sit in any order. The XML import page recaps the four steps of the upload, and a full example file is there to download and open, if copying beats reading.
<?xml version="1.0"?>
<playlist>
<track>
<title>Blinding Lights</title>
<artist>The Weeknd</artist>
</track>
<track>
<title>Levitating</title>
<artist>Dua Lipa</artist>
<album>Future Nostalgia</album>
</track>
<track>
<title>Bohemian Rhapsody</title>
<artist>Queen</artist>
<isrc>FRAB50712345</isrc>
</track>
</playlist>
The four tags
Two things decide whether the file is recognized
-
The XML declaration sits on the very first line
That first line is what tells us the file is XML. Anything above it, a comment or a blank line, and we look at the file as plain text instead. -
At least one track carries a title
A track with no title is skipped without a word, and a file where none of them has one is not read as a playlist at all. Compare the number of tracks found with the number of tracks in your file.
Playlists, and playlists only
This format builds a playlist. Favorite tracks, albums, and artists are imported from other file types, so a library backup written in XML cannot go back in as favorites.
Sending back a file we exported
Export a playlist as XML and it comes back in without a single edit. Our own file carries more than the four tags, an identifier, a platform, a duration, a date, and a link among them, and the reader picks up the ones it needs. That file is also the safest model to copy if you are writing yours by hand.
Other XML files go in as they are
Several music tools write XML of their own, and each one is recognized on sight. None of them needs converting first:
Frequently Asked Questions
Does the root element have to be named playlist?
No. We read whatever the root contains, so its name is yours to choose. The one thing that matters is that it holds tracks, and that at least one of them has a title.
How big can the file be?
Up to 2 MB, one file at a time. A longer library can be split in two and imported one part after the other.
Fewer tracks came in than the file holds. Why?
A track with an empty title is dropped as the file is read, quietly. Look for the missing ones in your file first, then at the matches Soundiiz proposes, which is a different step and a different reason.
Would another format work better?
For a playlist, XML and CSV do the same job. CSV is easier to write by hand and it is the only one that also imports favorites, so it is the safer starting point when you build the file yourself.