Create an XML document from a here document
#!/usr/bin/env ruby require 'rexml/document' include REXML address = <<XML <address> <name><given>A</given><family>B</family></name> <street>9876 St.</street> <city>CA</city> <state>Colorado</state> <code>81000</code> <country>USA</country> </address> XML document = Document.new( address ) puts document