original_string: public function convertXml($xml)
      {
          try {
              $xml = Xml::build($xml, ['return' => 'domdocument', 'readFile' => false]);
              // We might not get child nodes if there are nested inline entities.
              if ((int)$xml->childNodes->length > 0) {
                  return Xml::toArray($xml);
              }
  
              return [];
          } catch (XmlException $e) {
              return [];
          }
      }
code: public function convertXml($xml)
      {
          try {
              $xml = Xml::build($xml, ['return' => 'domdocument', 'readFile' => false]);
              // We might not get child nodes if there are nested inline entities.
              if ((int)$xml->childNodes->length > 0) {
                  return Xml::toArray($xml);
              }
  
              return [];
          } catch (XmlException $e) {
              return [];
          }
      }
code_tokens: public function convertXml ( $ xml ) { try { $ xml = Xml :: build ( $ xml , [ 'return' => 'domdocument' , 'readFile' => false ] ) ; // We might not get child nodes if there are nested inline entities. if ( ( int ) $ xml -> childNodes -> length > 0 ) { return Xml :: toArray ( $ xml ) ; } return [ ] ; } catch ( XmlException $ e ) { return [ ] ; } }
docstring: Helper method to parse xml input data, due to lack of anonymous functions
  this lives here.
  
  @param string $xml XML string.
  @return array Xml array data
docstring_tokens: Helper method to parse xml input data due to lack of anonymous functions this lives here .