private function getAttributesXpath(array $attributes)
    {
        $xpath = '';
        if (!empty($attributes)) {
            $parts = [];
            foreach ($attributes as $key => $value) {
                $parts[] = '@' . $key . '="' . $value . '"';
            }

            $xpath .= '[' . implode(' and ', $parts) . ']';
        }

        return $xpath;
    }