public function build($schema_config, $indent = true)
{
$this->schema_config = $schema_config;
// we're gonna create XSD (XML) using a XmlWriter
$writer = new \XMLWriter();
$writer->openMemory();
if ($indent) {
$writer->setIndent(true);
// will be easier to read
$writer->setIndentString(' ');
// soft tab, 4 spaces
}
$writer->startDocument('1.0', 'UTF-8');
// build writer - use a reference, we don't want to recopy it each time
$this->buildRootNode($schema_config['root'][$this->getFullName('type')], $schema_config['root'], $writer);
$writer->endDocument();
return $writer->outputMemory();
}