code: public function trySimpleXMLLoadString($pFilename)
      {
          try {
              $xml = simplexml_load_string(
                  $this->securityScan(file_get_contents($pFilename)),
                  'SimpleXMLElement',
                  Settings::getLibXmlLoaderOptions()
              );
          } catch (\Exception $e) {
              throw new Exception('Cannot load invalid XML file: ' . $pFilename, 0, $e);
          }
  
          return $xml;
      }
docs: Check if the file is a valid SimpleXML.
  
  @param string $pFilename
  
  @throws Exception
  
  @return false|\SimpleXMLElement