def get_object_as_xml(inst, cls=None, root_tag_name=None, no_namespace=False):
 if (cls is None):
  cls = inst.__class__
 if ((cls.get_namespace() is None) and (no_namespace is None)):
  no_namespace = True
 if (no_namespace is None):
  no_namespace = False
 parent = etree.Element('parent')
 xml_object.to_parent(None, cls, inst, parent, cls.get_namespace(), root_tag_name)
 if no_namespace:
  _dig(parent)
  etree.cleanup_namespaces(parent)
 return parent[0]

def get_object_as_xml ( inst , cls = None , root_tag_name = None , no_namespace = False ) : if ( cls is None ) : cls = inst . __class__ if ( ( cls . get_namespace ( ) is None ) and ( no_namespace is None ) ) : no_namespace = True if ( no_namespace is None ) : no_namespace = False parent = etree . Element ( 'parent' ) xml_object . to_parent ( None , cls , inst , parent , cls . get_namespace ( ) , root_tag_name ) if no_namespace : _dig ( parent ) etree . cleanup_namespaces ( parent ) return parent [ 0 ]
returns an elementtree representation of a :class:spyne .