/** * Creates a new Node with the same name, no parent, shallow cloned attributes * and if the value is a NodeList, a (deep) clone of those nodes. * * @return the clone */ @Override public Object clone() { Object newValue = value; if (value instanceof NodeList) { NodeList nodes = (NodeList) value; newValue = nodes.clone(); } return new Node(null, name, new HashMap(attributes), newValue); }