def xml_from_template
template_options={
:cpus => cpus,
:memory_size => memory_size,
:domain_type => domain_type,
:name => name,
:iso_file => iso_file,
:iso_dir => iso_dir,
:os_type => os_type,
:arch => arch,
:volume_path => volume_path,
:volume_format_type => volume_format_type,
:network_interface_type => network_interface_type,
:network_nat_network => network_nat_network,
:network_bridge_name => network_bridge_name
}
vars = ErbBinding.new(template_options)
template_path = File.join(File.dirname(__FILE__),"templates","server.xml.erb")
template = File.open(template_path).readlines.join
erb = ERB.new(template)
vars_binding = vars.send(:get_binding)
erb.result(vars_binding)
end