original_string: public function writeXml($xml)
      {
          if ($this->writeObjectReference($xml)) {
              return $this;
          }
  
          if(is_string($xml)) {
              //nothing to do
          } else if ($xml instanceof DOMDocument) {
              $xml = $xml->saveXml();
          } else if ($xml instanceof SimpleXMLElement) {
              $xml = $xml->asXML();
          } else {
              require_once 'Zend/Amf/Exception.php';
              throw new Zend_Amf_Exception('Invalid xml specified; must be a DOMDocument or SimpleXMLElement');
          }
  
          $this->writeBinaryString($xml);
  
          return $this;
      }
code: public function writeXml($xml)
      {
          if ($this->writeObjectReference($xml)) {
              return $this;
          }
  
          if(is_string($xml)) {
              //nothing to do
          } else if ($xml instanceof DOMDocument) {
              $xml = $xml->saveXml();
          } else if ($xml instanceof SimpleXMLElement) {
              $xml = $xml->asXML();
          } else {
              require_once 'Zend/Amf/Exception.php';
              throw new Zend_Amf_Exception('Invalid xml specified; must be a DOMDocument or SimpleXMLElement');
          }
  
          $this->writeBinaryString($xml);
  
          return $this;
      }
code_tokens: public function writeXml ( $ xml ) { if ( $ this -> writeObjectReference ( $ xml ) ) { return $ this ; } if ( is_string ( $ xml ) ) { //nothing to do } else if ( $ xml instanceof DOMDocument ) { $ xml = $ xml -> saveXml ( ) ; } else if ( $ xml instanceof SimpleXMLElement ) { $ xml = $ xml -> asXML ( ) ; } else { require_once 'Zend/Amf/Exception.php' ; throw new Zend_Amf_Exception ( 'Invalid xml specified; must be a DOMDocument or SimpleXMLElement' ) ; } $ this -> writeBinaryString ( $ xml ) ; return $ this ; }
docstring: Send xml to output stream
  
  @param  DOMDocument|SimpleXMLElement  $xml
  @return Zend_Amf_Parse_Amf3_Serializer
docstring_tokens: Send xml to output stream