node = self.dup(0)
attr = self.attributes
attr.each { |k, v| node[k] = v } unless attr.empty?
node
If you're doing a shallow copy, then no. The shallow copy only copies
the immediate node, so when it says shallow, it *means* shallow. heh.
A deep copy would do the trick, but you'd have to unlink the child
nodes. For example:
node = other_node.dup
node.children.each { |x| x.unlink }
--
Aaron Patterson
http://tenderlovemaking.com/