private function parseXml($file)
{
$formats = [];
// load xml file
$xmlDoc = $this->tryLoad($file);
$this->xpath = new \DOMXPath($xmlDoc);
$this->xpath->registerNamespace('x', static::XML_NAMESPACE_URI);
foreach ($this->xpath->query('/x:formats/x:format') as $formatNode) {
$this->addFormatFromFormatNode($formatNode, $formats);
}
return $formats;
}