original_string: protected function xmlSerialize($data, $xml = null)
      {
          if ( !$xml instanceof SimpleXMLElement )
          {
              $xml = new SimpleXMLElement('<'. $this->requestName .' xmlns="'. $this->namespace .'" />');
          }
  
          foreach ($data as $key => $value)
          {
              if ( !isset($value) )
              {
                  continue;
              }
  
              if ( is_array($value) )
              {
                  $node = $xml->addChild($key);
                  $this->xmlSerialize($value, $node);
              }
              else
              {
                  $xml->addChild($key, $value);
              }
          }
  
          return $xml->asXML();
      }
code: protected function xmlSerialize($data, $xml = null)
      {
          if ( !$xml instanceof SimpleXMLElement )
          {
              $xml = new SimpleXMLElement('<'. $this->requestName .' xmlns="'. $this->namespace .'" />');
          }
  
          foreach ($data as $key => $value)
          {
              if ( !isset($value) )
              {
                  continue;
              }
  
              if ( is_array($value) )
              {
                  $node = $xml->addChild($key);
                  $this->xmlSerialize($value, $node);
              }
              else
              {
                  $xml->addChild($key, $value);
              }
          }
  
          return $xml->asXML();
      }
code_tokens: protected function xmlSerialize ( $ data , $ xml = null ) { if ( ! $ xml instanceof SimpleXMLElement ) { $ xml = new SimpleXMLElement ( '<' . $ this -> requestName . ' xmlns="' . $ this -> namespace . '" />' ) ; } foreach ( $ data as $ key => $ value ) { if ( ! isset ( $ value ) ) { continue ; } if ( is_array ( $ value ) ) { $ node = $ xml -> addChild ( $ key ) ; $ this -> xmlSerialize ( $ value , $ node ) ; } else { $ xml -> addChild ( $ key , $ value ) ; } } return $ xml -> asXML ( ) ; }
docstring: Serializes an array into XML
  
  @param array $data Array to serialize into XML.
  @param \SimpleXMLElement $xml SimpleXMLElement object.
  
  @return string XML
docstring_tokens: Serializes an array into XML