static Playlist playlistFromElement(DomElement e) {
		if (e == null)
			return null;
		Playlist p = new Playlist();
		if (e.hasChild("id"))
			p.id = Integer.parseInt(e.getChildText("id"));
		p.title = e.getChildText("title");
		if (e.hasChild("size"))
			p.size = Integer.parseInt(e.getChildText("size"));
		p.creator = e.getChildText("creator");
		p.annotation = e.getChildText("annotation");
		DomElement tl = e.getChild("trackList");
		if (tl != null) {
			for (DomElement te : tl.getChildren("track")) {
				Track t = new Track(te.getChildText("title"), te.getChildText("identifier"),
						te.getChildText("creator"));
				t.album = te.getChildText("album");
				t.duration = Integer.parseInt(te.getChildText("duration")) / 1000;
				t.imageUrls.put(ImageSize.LARGE, te.getChildText("image"));
				t.imageUrls.put(ImageSize.ORIGINAL, te.getChildText("image"));
				t.location = te.getChildText("location");
				for (DomElement ext : te.getChildren("extension")) {
					if ("http://www.last.fm".equals(ext.getAttribute("application"))) {
						for (DomElement child : ext.getChildren()) {
							t.lastFmExtensionInfos.put(child.getTagName(), child.getText());
						}
					}
				}
				p.tracks.add(t);
			}
			if (p.size == 0)
				p.size = p.tracks.size();
		}
		return p;
	}