/** * Return the Xml representation of this <code>Subscription</code> as required * for the {@link org.apache.jackrabbit.webdav.observation.SubscriptionDiscovery} * webdav property that in included in the response body of a successful SUBSCRIBE * request or as part of a PROPFIND response. * * @return Xml representation * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document) * @param document */ public Element toXml(Document document) { Element subscr = DomUtil.createElement(document, XML_SUBSCRIPTION, NAMESPACE); subscr.appendChild(info.toXml(document)); subscr.appendChild(DomUtil.depthToXml(info.isDeep(), document)); subscr.appendChild(DomUtil.timeoutToXml(info.getTimeOut(), document)); if (getSubscriptionId() != null) { Element id = DomUtil.addChildElement(subscr, XML_SUBSCRIPTIONID, NAMESPACE); id.appendChild(DomUtil.hrefToXml(getSubscriptionId(), document)); } DomUtil.addChildElement(subscr, XML_EVENTSWITHTYPES, NAMESPACE, Boolean.toString(eventsProvideNodeTypeInformation())); DomUtil.addChildElement(subscr, XML_EVENTSWITHLOCALFLAG, NAMESPACE, Boolean.toString(eventsProvideNoLocalFlag())); return subscr; }