protected static function export($dom = null) {
		if (!is_a($dom, 'DOMDocument')) {
			return false;
		}

		try {
			$svgs = $dom->getElementsByTagName('svg');
			if (!$svgs->length) {
				return false;
			}
			$svg = $svgs->item(0)->ownerDocument->saveXML($svgs->item(0), LIBXML_NOBLANKS);

			// Remove comments.
			$svg = static::strip_comments($svg);

			return $svg;
		} catch (\Throwable $e) {
			error_log($e->getMessage());
			return false;
		} catch (\Exception $e) {
			return false;
		}

		return false;
	}