You may run into a problem if a track has more than one artist.
You'd have to enter the track for each artist again, or you'd have to only use the first artist, or you'd have to create a new "combined" artist.
Why not omit the artist→track hierarchy?
<collection>
<track>
<title>Thriller</title>
<artist>Michael Jackson</artist>
</track>
<track>
<title>Hey Jude</title>
<artist>The Beatles</artist>
</track>
</collection>
Benefits:
- You can add more metadata for tracks (composer, album, etc.)
- You can add tracks without title and/or artist
- If different artists may the same name, you could
id
'fy theartist
elements
If different artists may have the same name, you'd need a way to differentiate the artist
elements; e.g. by using id
with an ID of an artist database.