Recently (very recently) we've added switched to favor REXML when dealing with XML:

https://github.com/rapid7/metasploit-framework/blob/master/HACKING#L91

Here is a sample about how to switch from plain strings to REXML for SOAP XML:

https://github.com/jvazquez-r7/metasploit-framework/commit/6ccbf1fe12ff8ba36aced953f5cbf7cf98407001