If you use Ruby and REXML on OS X you should know there's a bug that prevents writing REXML documents to a file. Take a look at this bug report, but the file you want is in /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby/1.8.rexml/document.rb
Read more