protected function addSiteId($siteId, $template)
	{
		$dom   = TemplateLoader::load($template);
		$xpath = new DOMXPath($dom);
		$query = '//*[namespace-uri() != "' . TemplateLoader::XMLNS_XSL . '"]'
		       . '[not(ancestor::*[namespace-uri() != "' . TemplateLoader::XMLNS_XSL . '"])]';
		foreach ($xpath->query($query) as $element)
		{
			$element->setAttribute('data-s9e-mediaembed', $siteId);
		}

		return TemplateLoader::save($dom);
	}