if (collectionElement.getAttributeNS(null, ATTRIBUTE_ID) == null | collectionElement.getAttribute(ATTRIBUTE_ID).equals("")) {
collectionElement.setAttributeNS(null, ATTRIBUTE_ID, this.getId());
}
Element[] existingDocumentElements = helper.getChildren(collectionElement, ELEMENT_DOCUMENT);
for (int i = 0; i < existingDocumentElements.length; i++) {
collectionElement.removeChild(existingDocumentElements[i]);
}
collectionElement.normalize();
NodeList emptyTextNodes = XPathAPI.selectNodeList(collectionElement, "text()");