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 [];
        }
    }
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 [];
        }
    }
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 [ ] ; } }
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
Helper method to parse xml input data due to lack of anonymous functions this lives here .