Implement ContentObject.to_xml() method.