attribute("hidden", field.isHidden()));
if (field.hasPosition()) {
element.setAttribute("position", "" + field.getPosition());
}
if (field instanceof DateField) {
DateField dateField = (DateField)field;
addText(element, DateSerializer.toString(dateFormat, dateField.getDate()));
} else if (field instanceof FileField) {
FileField fileField = (FileField)field;
if (fileField.getEditMediaLink() != null) {
Element link = element(Namespace.ATOM.getUrl(), "link",
attribute("href", fileField.getEditMediaLink().getHref()),