def optional_value(xpath, type)
      value_def = @entry.at_xpath(xpath, HQMF2::Document::NAMESPACES)
      return unless value_def
      if value_def['flavorId'] == 'ANY.NONNULL'
        AnyValue.new
      else
        created_value = Value.new(value_def, type)
        # Return nil if no value was parsed
        created_value if created_value.try(:value)
      end
    end
def optional_value(xpath, type)
      value_def = @entry.at_xpath(xpath, HQMF2::Document::NAMESPACES)
      return unless value_def
      if value_def['flavorId'] == 'ANY.NONNULL'
        AnyValue.new
      else
        created_value = Value.new(value_def, type)
        # Return nil if no value was parsed
        created_value if created_value.try(:value)
      end
    end
Either derives a value from a specific path or generates a new value (or returns nil if none found)