def value_from_xml(node)
      if type.respond_to?(:new_from_xml)
        type.new_from_xml(node)
      elsif type.is_a?(Array)
        node.children.map do |sub_node|
          sub_field.value_from_xml(sub_node)
        end
      elsif type == Boolean
        node.text == "true"
      elsif type == Integer
        node.text.to_i unless node.text.empty?
      elsif type == Time
        Time.xmlschema(node.text) unless node.text.empty?
      else
        node.text
      end
    end
def value_from_xml(node)
      if type.respond_to?(:new_from_xml)
        type.new_from_xml(node)
      elsif type.is_a?(Array)
        node.children.map do |sub_node|
          sub_field.value_from_xml(sub_node)
        end
      elsif type == Boolean
        node.text == "true"
      elsif type == Integer
        node.text.to_i unless node.text.empty?
      elsif type == Time
        Time.xmlschema(node.text) unless node.text.empty?
      else
        node.text
      end
    end
Convert XML to Ruby value