public Track add(Track track) { synchronized (this) { Track copy; if ((copy = getTrack(track)) == null) { copy = new Track((Element) doc.importNode(track.getElement(), false)); docElt.appendChild(copy.getElement()); tracks.add(copy); hash.put(copy.getKey(), copy); } return copy; } }
public XML addChild(XML child) { Document document = node.getOwnerDocument(); Node newChild = document.importNode((Node) child.getNative(), true); return appendChild(newChild); }