XML format for mp3 files I'm developing a desktop app that will scan a user's system for mp3 files and send their whole collection to a website. I'm assuming the best file format for sending this data to a server would be XML -- although correct me if I'm wrong.

Can someone kindly comment on whether the formatting of the sample XML file below looks okay? Thanks!

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;collection&gt;
    &lt;artist name="Michael Jackson"&gt;
        &lt;track&gt;Beat It&lt;/track&gt;
        &lt;track&gt;Thriller&lt;/track&gt;
    &lt;/artist&gt;
    &lt;artist name="The Beatles"&gt;
        &lt;track&gt;Hey Jude&lt;/track&gt;
        &lt;track&gt;Yellow Submarine&lt;/track&gt;
    &lt;/artist&gt;
    &lt;artist name="Eminem"&gt;
        &lt;track&gt;Lose Yourself&lt;/track&gt;
        &lt;track&gt;Without Me&lt;/track&gt;
    &lt;/artist&gt;
&lt;/collection&gt;
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?

&lt;collection&gt;
  &lt;track&gt;
    &lt;title&gt;Thriller&lt;/title&gt;
    &lt;artist&gt;Michael Jackson&lt;/artist&gt;
  &lt;/track&gt;
  &lt;track&gt;
    &lt;title&gt;Hey Jude&lt;/title&gt;
    &lt;artist&gt;The Beatles&lt;/artist&gt;
  &lt;/track&gt;
&lt;/collection&gt; 


Benefits:


You can add more metadata for tracks (composer, album, etc.)
You can add tracks without title and/or artist


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.