diff --git a/lib/roxml/xml.rb b/lib/roxml/xml.rb
index <HASH>..<HASH> 100644
--- a/lib/roxml/xml.rb
+++ b/lib/roxml/xml.rb
@@ -200,7 +200,7 @@ module ROXML
         value.each do |v|
           xml.child_add(v.to_xml(name))
         end
-      elsif value.respond_to? :tag_refs
+      elsif value.is_a?(ROXML)
         xml.child_add(value.to_xml(name))
       else
         node = XML::Node.new_element(name)
Cleaner way of differentiating between ROXML and self-defined #to_xml types