code: def serialize_single_xso(x):
      
      buf = io.BytesIO()
      gen = XMPPXMLGenerator(buf,
                             short_empty_elements=True,
                             sorted_attributes=True)
      x.unparse_to_sax(gen)
      return buf.getvalue().decode("utf8")
docs: Serialize a single XSO `x` to a string. This is potentially very slow and
      should only be used for debugging purposes. It is generally more efficient
      to use a :class:`XMPPXMLGenerator` to stream elements.