I found that was easier to use the Java library XMLUnit than any native solution
require 'java'
require '/usr/share/java/xmlunit.jar'
java_import org.custommonkey.xmlunit.Diff
puts Diff.new("", "").similar
puts Diff.new("", "").similar
Of course, this means you have to use JRuby instead of CRuby, but that wasn't a significant obstacle in my case.