//url:
Element urlElem = elem.getChild("url");
if (urlElem == null)
throw new IOException("Invalid URLFile: Missing required 'url' element");
URLFile file = new URLFile(urlElem.getText());
//name:
Element nameElem = elem.getChild("name");
if (nameElem != null)
file.setName(nameElem.getText());
return file;
}