// create entry for media
Entry entry = parent.createEntry();
// create entry media
entry.createResource(name, type);
// creae entry document
Document doc = AtomResource.createMediaEntryDocument(name,entry.getUUID(),entry.getCreated(),null,name,type);
Writer out = new OutputStreamWriter(new FileOutputStream(new File(file.getParentFile(),"."+entry.getUUID()+".atom")),"UTF-8");
XMLWriter.writeDocument(doc, out);