@OP:

There is a dclone() method that is added to the Array class, by the 
library file: "lib/rexml/xpath_parser.rb"

You could load that file, or steal the method definition for your own 
custom Array subclass.

It is not a good idea to override Base class instance methods, but you 
could if your code will not be released (used only internally.)

Changing base classes, in released packages, could interfere with other 
packages. (Making users and other Ruby authors angry.)

General "rule of thumb".. if you can use a custom subclass, rather than 
modifying a base class, than do so. (A must if your code runs within a 
shared Ruby process where other authors code is also running, such as 
Applications that run Ruby as an embedded scripting host.)

-- 
Posted via http://www.ruby-forum.com/.