protected function mergeDatabaseElement(\DOMElement $sourceDatabaseElement)
    {
        $database = $this->getDatabaseFromDatabaseElement($sourceDatabaseElement);

        $this->initGlobalDatabaseElement($database);

        $globalDatabaseElement = $this->globalDatabaseElements[$database];

        // add a source schema start marker
        $fileStartMarkerComment = $globalDatabaseElement->ownerDocument->createComment(
            "Start of schema from '{$sourceDatabaseElement->ownerDocument->baseURI}'"
        );
        $globalDatabaseElement->appendChild($fileStartMarkerComment);

        // merge the element
        foreach ($sourceDatabaseElement->childNodes as $childNode) {
            $importedNode = $globalDatabaseElement->ownerDocument->importNode($childNode, true);
            $globalDatabaseElement->appendChild($importedNode);
        }

        // and a source schema end marker
        $fileEndMarkerComment = $globalDatabaseElement->ownerDocument->createComment(
            "End of schema from '{$sourceDatabaseElement->ownerDocument->baseURI}'"
        );
        $globalDatabaseElement->appendChild($fileEndMarkerComment);

        $this->sourceDatabaseElements[$database][] = $sourceDatabaseElement;
    }