} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage());
}
}
public void writeTo(OutputStream out) throws IOException {
ExternalLinkDocument doc = ExternalLinkDocument.Factory.newInstance();
doc.setExternalLink(link);
doc.save(out, DEFAULT_XML_OPTIONS);
}