First, I am assuming that you are talking about changing some attributes on a bunch of elements. That being said, you do not want to read the whole document at once (DOM based parsing), you really want to deal with elements as you see them (SAX based parsing). I am not a ruby person, but a quick search turned up some good info on SAX parsing in Ruby, in particular this post http://lucaguidi.com/2008/01/30/ruby-xml-parsing-with-sax.
If you only have a few attributes on a small number of elements, then I would recommend a different approach. First, if you can specify the items you want to change as a regular expression it may be simpler to use a command-line tool like sed to edit the files.