Provides support to parse and create an in-memory representation of a XML Schema document.
composer require cmaymard/php-xml-schema
<?php
use PhpXmlSchema\Dom\Parser;
$src = \file_get_contents('schema.xsd');
$parser = new Parser();
// $schema is an instance of PhpXmlSchema\Dom\SchemaElement.
$schema = $parser->parse($src);
See the documentation.