public function addAttribute( $name, $value = NULL, $nsPrefix = NULL, $nsURI = NULL )
	{
		$key	= $nsPrefix ? $nsPrefix.':'.$name : $name;
		if( $nsPrefix )
		{
			$namespaces	= $this->getDocNamespaces();
			$key		= $nsPrefix ? $nsPrefix.':'.$name : $name;
			if( $this->hasAttribute( $name, $nsPrefix ) )
				throw new RuntimeException( 'Attribute "'.$key.'" is already set' );
			if( array_key_exists( $nsPrefix, $namespaces ) )
				return parent::addAttribute( $key, $value, $namespaces[$nsPrefix] );
			if( $nsURI )
				return parent::addAttribute( $key, $value, $nsURI );
			throw new RuntimeException( 'Namespace prefix is not registered and namespace URI is missing' );
		}
		if( $this->hasAttribute( $name ) )
			throw new RuntimeException( 'Attribute "'.$name.'" is already set' );
		parent::addAttribute( $name, $value );
	}