Serialize the object to xml
550167
def to_xml_string(str = '')
      str << "<filters #{serialized_attributes}>"
      filter_items.each {  |filter| filter.to_xml_string(str) }
      date_group_items.each { |date_group_item| date_group_item.to_xml_string(str) }
      str << '</filters>'
    end
786463
def to_xml(self):
        
        makeValid = make_valid_xml_value

        xml = '<xml><more>%s</more>' % (self.more)

        for message_type, message in self.console_messages:
            xml += '<%s message="%s"></%s>' % (message_type, makeValid(message), message_type)

        xml += '</xml>'

        return xml
288270
def serialize(self):
        
        converted_dict = {
            'success': self.success,
            'assertion': str(self),
            'required': self.required
        }
        return converted_dict
658657
def serialize(self, obj, fields):
        

        data = {}
        remaining_fields = []
        for field in fields:
            if callable(field):  # Callable
                data[field.__name__] = field(obj)
            elif hasattr(self, field) and callable(getattr(self, field)):  # Method on the view
                data[field] = getattr(self, field)(obj)
            elif hasattr(obj, field):  # Callable/property/field on the model
                attr = getattr(obj, field)
                if isinstance(attr, Model):
                    data[field] = attr.pk
                elif isinstance(attr, Manager):
                    data[field] = [item['pk'] for item in attr.values('pk')]
                elif callable(attr):  # Callable on the model
                    data[field] = attr()
                else:
                    remaining_fields.append(field)
            else:
                raise AttributeError('Invalid field: %s' % field)

        # Add on db fields
        serializer = Serializer()
        serializer.serialize([obj], fields=list(remaining_fields))
        data.update(serializer.getvalue()[0]['fields'])

        # Any remaining fields should be properties on the model
        remaining_fields = set(remaining_fields) - set(data.keys())

        for field in remaining_fields:
            data[field] = getattr(obj, field)

        return data
528344
def serialize(cls, obj):
        

        cls._initialize()
        serializer = cls._get_serializer(type(obj))

        if serializer == cls:
            return cls._serialize_default(obj)
        else:
            return serializer.serialize(obj)
825616
@Override
    public String serialize(Object obj) throws JsonMarshallingException {
        try {
            return serializeChecked(obj);
        } catch (Exception e) {
            throw new JsonMarshallingException(e);
        }
    }
1347838
def to_xml(opts={})
      exclude = opts[:exclude] || []
      exclude << :errors
      
      tag     = opts[:tag] || RSpreedly.underscore(self.class.to_s)
      inner   = opts[:inner]
      outer   = opts[:outer]      
      no_tag  = opts[:no_tag]
      
      xml = ""
      xml << "<#{outer}>" if outer
      xml << "<#{tag}>" unless no_tag
      xml << "<#{inner}>" if inner
      self.instance_variables.each do |var|
        name = var.to_s.gsub('@', '')
        next if exclude.include?(name.to_sym)
        value = self.instance_variable_get(var)
        if value.respond_to?(:to_xml)
          value = value.to_xml(:no_tag => (RSpreedly.underscore(value.class.to_s) == name)) 
        end
        xml << "<#{name}>#{value}</#{name}>"
      end
      xml << "</#{inner}>" if inner      
      xml << "</#{tag}>" unless no_tag
      xml << "</#{outer}>" if outer      
      xml
    end
1239635
def toxml(self):
        

        return '<Property name="{0}"'.format(self.name) +\
          (' dimension="{0}"'.format(self.dimension) if self.dimension else 'none') +\
          (' defaultValue = "{0}"'.format(self.default_value) if self.default_value else '') +\
          '/>'
652350
def to_xml_string(str="")
      serialized_tag('dataBar', str) do
        value_objects.to_xml_string(str)
        self.color.to_xml_string(str)
      end
    end
540293
def to_xml(data)
      ox = XML::Node.new(ox_tag)
      wrappers = {}
      
      ox_elems.each do |elem|
        if elem.in
          wrappers[elem.in] ||= XML::Node.new elem.in
          elem.to_xml(data).each {|e| wrappers[elem.in] << e}
        else
          elem.to_xml(data).each {|e| ox << e}
        end
      end
      
      wrappers.each {|k,v| ox << v}
      
      ox_attrs.each do |a| 
        val = data.send(a.accessor).to_s
        ox[a.tag]= val if val.present?
      end
      
      ox
    end
1057959
public void toXml(Object object, OutputStream out, Class<?>... clas) {
		try {
			JAXBContext jaxbContext = JAXBContext.newInstance(clas);
			Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
			// output pretty printed
			jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
			jaxbMarshaller.marshal(object, out);
		} catch (JAXBException e) {
			throw new JKException(e);
		}
	}
605410
def to_xml(options={})
      options[:indent] ||= 2
      xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
      xml.instruct! unless options[:skip_instruct]

      obj_name = self.class.resource_name.singularize
      
      # Turn our OpenStruct attributes into a hash we can export to XML
      obj_attrs = self.marshal_dump
      
      xml.tag!(obj_name) do
        obj_attrs.each do |key,value|
          next if key.to_sym == :link # Don't feed back links to server
          case value
            when ::Hash
              value.to_xml(
                options.merge({ 
                  :root => key, 
                  :skip_instruct => true 
                })
              )
            when ::Array
              value.to_xml(
                options.merge({ 
                  :root => key, 
                  :children => key.to_s.singularize, 
                  :skip_instruct => true
                })
              )
            else
              xml.tag!(key, value)
          end
        end
      end
    end
754469
private void _serialize(Object object, StringBuilder sb, Set<Object> done) throws ConverterException {
	// try {
	deep++;
	// NULL
	if (object == null) {
	    sb.append(goIn());
	    sb.append("nullValue()");
	    deep--;
	    return;
	}
	// String
	if (object instanceof String) {
	    sb.append(goIn());
	    sb.append(QUOTE_CHR);
	    sb.append(escape(object.toString()));
	    sb.append(QUOTE_CHR);
	    deep--;
	    return;
	}
	if (object instanceof TimeZone) {
	    sb.append(goIn());
	    sb.append(QUOTE_CHR);
	    sb.append(escape(((TimeZone) object).getID()));
	    sb.append(QUOTE_CHR);
	    deep--;
	    return;
	}
	if (object instanceof Locale) {
	    sb.append(goIn());
	    sb.append(QUOTE_CHR);
	    sb.append(LocaleFactory.toString((Locale) object));
	    sb.append(QUOTE_CHR);
	    deep--;
	    return;
	}
	// Number
	if (object instanceof Number) {
	    sb.append(goIn());
	    sb.append(Caster.toString(((Number) object)));
	    deep--;
	    return;
	}
	// Boolean
	if (object instanceof Boolean) {
	    sb.append(goIn());
	    sb.append(Caster.toString(((Boolean) object).booleanValue()));
	    deep--;
	    return;
	}
	// DateTime
	if (object instanceof DateTime) {
	    _serializeDateTime((DateTime) object, sb);
	    deep--;
	    return;
	}
	// Date
	if (object instanceof Date) {
	    _serializeDate((Date) object, sb);
	    deep--;
	    return;
	}
	// XML
	if (object instanceof Node) {
	    _serializeXML((Node) object, sb);
	    deep--;
	    return;
	}
	if (object instanceof ObjectWrap) {
	    try {
		_serialize(((ObjectWrap) object).getEmbededObject(), sb, done);
	    }
	    catch (PageException e) {
		throw toConverterException(e);
	    }
	    deep--;
	    return;
	}
	// Timespan
	if (object instanceof TimeSpan) {
	    _serializeTimeSpan((TimeSpan) object, sb);
	    deep--;
	    return;
	}
	Object raw = LazyConverter.toRaw(object);
	if (done.contains(raw)) {
	    sb.append(goIn());
	    sb.append("nullValue()");
	    deep--;
	    return;
	}

	done.add(raw);
	try {
	    // Component
	    if (object instanceof Component) {
		_serializeComponent((Component) object, sb, done);
		deep--;
		return;
	    }

	    // Struct
	    if (object instanceof Struct) {
		_serializeStruct((Struct) object, sb, done);
		deep--;
		return;
	    }
	    // Map
	    if (object instanceof Map) {
		_serializeMap((Map) object, sb, done);
		deep--;
		return;
	    }
	    // Array
	    if (object instanceof Array) {
		_serializeArray((Array) object, sb, done);
		deep--;
		return;
	    }
	    // List
	    if (object instanceof List) {
		_serializeList((List) object, sb, done);
		deep--;
		return;
	    }
	    // Query
	    if (object instanceof Query) {
		_serializeQuery((Query) object, sb, done);
		deep--;
		return;
	    }
	    // String Converter
	    if (object instanceof ScriptConvertable) {
		sb.append(((ScriptConvertable) object).serialize());
		deep--;
		return;
	    }
	    if (object instanceof Serializable) {
		_serializeSerializable((Serializable) object, sb);
		deep--;
		return;
	    }
	}
	finally {
	    done.remove(raw);
	}
	throw new ConverterException("can't serialize Object of type [ " + Caster.toClassName(object) + " ]");
	// deep--;
	/*
	 * } catch(StackOverflowError soe){ throw soe; }
	 */
    }
39593
def to_xml(self):
        """"""
        changesXML = ""
        for change in self.changes:
            changeParams = {"action": change[0], "record": change[1].to_xml()}
            changesXML += self.ChangeXML % changeParams
        params = {"comment": self.comment, "changes": changesXML}
        return self.ChangeResourceRecordSetsBody % params
815980
def to_element(self, root_name=None):
        """"""
        if not root_name:
            root_name = self.nodename
        elem = ElementTreeBuilder.Element(root_name)
        for attrname in self.serializable_attributes():
            # Only use values that have been loaded into the internal
            # __dict__. For retrieved objects we look into the XML response at
            # access time, so the internal __dict__ contains only the elements
            # that have been set on the client side.
            try:
                value = self.__dict__[attrname]
            except KeyError:
                continue

            if attrname in self.xml_attribute_attributes:
                elem.attrib[attrname] = six.text_type(value)
            else:
                sub_elem = self.element_for_value(attrname, value)
                elem.append(sub_elem)

        return elem
884574
public static String serialize(Object object) {
	if (object == null) return "[null]";
	try {
	    return new ScriptConverter().serialize(object);
	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	    return object.toString();
	}
    }
777895
public function serialize()
    {
        $objectData = array();

        foreach ($this as $propertyName => $propertyValue)
        {
            if (    is_scalar($propertyValue)
                ||  is_array($propertyValue)
                ||  $propertyValue instanceof Serializable)
            {
                $objectData[$propertyName] = $propertyValue;
            }
        }

        return serialize($objectData);
    }