use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\Config\FileLocator; $locator = new FileLocator([__DIR__ . '/config']); $loader = new XmlFileLoader($container, $locator); $loader->load('services.xml');
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; $container = new ContainerBuilder(); $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/config')); $loader->load('services.xml');This example shows how to create a container and load an XML config file with it using XmlFileLoader. It also uses the FileLocator class to locate the configuration file. In conclusion, the XmlFileLoader class is a part of the Symfony DependencyInjection component and is used to load XML configuration files and create containers from them. The package that this class belongs to is the "symfony/dependency-injection" package library.