def xml_from_template
allocation_size,allocation_unit=split_size_unit(self.allocation)
capacity_size,capacity_unit=split_size_unit(self.capacity)
template_options={
:name => self.name,
:format_type => self.format_type,
:allocation_size => allocation_size,
:allocation_unit => allocation_unit,
:capacity_size => capacity_size,
:capacity_unit => capacity_unit
}
vars = ErbBinding.new(template_options)
template_path=File.join(File.dirname(__FILE__),"templates","volume.xml.erb")
template=File.open(template_path).readlines.join
erb = ERB.new(template)
vars_binding = vars.send(:get_binding)
result=erb.result(vars_binding)
return result
end