// }
// }
// }
// writer.close()
public XMLElement toXml() {
final XMLElement addonElement = new XMLElement("addon");
addonElement.setAttribute("name", name);
addonElement.setAttribute("version", version);
addonElement.setAttribute("latestVersion", latestVersion == null ? "" : latestVersion);
addonElement.setAttribute("freeplaneVersionFrom", freeplaneVersionFrom.toString());
if (freeplaneVersionTo != null)
addonElement.setAttribute("freeplaneVersionTo", freeplaneVersionTo.toString());
if (homepage != null)
addonElement.setAttribute("homepage", homepage.toString());
if (updateUrl != null)
addonElement.setAttribute("updateUrl", updateUrl.toString());
if (author != null)
addonElement.setAttribute("author", author);
addonElement.setAttribute("active", Boolean.toString(active));
addAsChildWithContent(addonElement, "description", description);
addAsChildWithContent(addonElement, "license", license);
addAsChildWithContent(addonElement, "preferences.xml", preferencesXml);
addTranslationsAsChild(addonElement);
addDefaultPropertiesAsChild(addonElement);