protected function createElement($nodeName, $textContent = '')
	{
		$methodName = 'createElement';
		$args       = [$nodeName];

		// Add the text content for the new element
		if ($textContent !== '')
		{
			$args[] = htmlspecialchars($textContent, ENT_NOQUOTES, 'UTF-8');
		}

		// Handle namespaced elements
		$prefix = strstr($nodeName, ':', true);
		if ($prefix > '')
		{
			$methodName .= 'NS';
			array_unshift($args, $this->ownerDocument->lookupNamespaceURI($prefix));
		}

		return call_user_func_array([$this->ownerDocument, $methodName], $args);
	}