DOMDB.appendChild(transaction,target,ownerDocument.createTextNode("\n"));
   public void mergeEntry(final Txn transaction,final ElementImpl target,Element source,final String updated) {      final List toRemove = new ArrayList();      DOM.forEachChild(target,new NodeHandler() {         public void process(Node parent, Node child) {            if (child.getNodeType()==Node.ELEMENT_NODE) {               String ns = child.getNamespaceURI();               if (ns!=null && ns.equals(Atom.NAMESPACE_STRING)) {                  String lname = child.getLocalName();                  if (lname.equals("updated")) {                     // Changed updated                     DOMDB.replaceText(transaction,(ElementImpl)child,updated);                  } else if (lname.equals("link")) {                     String rel = ((Element)child).getAttribute("rel");                     if (!rel.equals("edit") && !rel.equals("edit-media")) {                        // remove it                        toRemove.add(child);                     }                  } else if (!lname.equals("id") && !lname.equals("published")) {                     // remove it                     toRemove.add(child);                  }               } else {                  // remove it                  toRemove.add(child);               }            } else {               toRemove.add(child);            }         }      });      for (Iterator childrenToRemove = toRemove.iterator(); childrenToRemove.hasNext(); ) {         Node child = (Node)childrenToRemove.next();         target.removeChild(transaction,child);      }      final Document ownerDocument = target.getOwnerDocument();      DOM.forEachChild(source,new NodeHandler() {         public void process(Node parent,Node child) {            if (child.getNodeType()==Node.ELEMENT_NODE) {               String ns = child.getNamespaceURI();               if (ns!=null && ns.equals(Atom.NAMESPACE_STRING)) {                  String lname = child.getLocalName();                                    // Skip server controls updated, published, and id elements                  if (lname.equals("updated") ||                      lname.equals("published") ||                      lname.equals("id")) {                     return;                  }                  // Skip the edit link relations                  if (lname.equals("link")) {                     String rel = ((Element)child).getAttribute("rel");                     if (!rel.equals("edit") && !rel.equals("edit-media")) {                        return;                     }                  }               }               DOMDB.appendChild(transaction,target,child);               DOMDB.appendChild(transaction,target,ownerDocument.createTextNode("\n"));            }         }      });   }