protected function _buildXMLHeader( MShop_Order_Item_Interface $invoice, MShop_Order_Item_Base_Interface $base,
		DOMDocument $dom, DOMElement $orderitem )
	{
		$regex = '/^(\d+)\-(\d+)\-(\d+) (\d+)\:(\d+)\:(\d+)$/i';
		$date = $invoice->getDatePayment();

		if ( ( $pdate = preg_replace( $regex, '$1-$2-$3T$4:$5:$6Z', $date ) ) === null ) {
				throw new MShop_Service_Exception( sprintf( 'Invalid characters in purchase date "%1$s"', $date ) );
		}

		$config = $this->getServiceItem()->getConfig();

		if( !isset( $config['default.project'] ) ) {
			throw new MShop_Service_Exception(
				sprintf( 'Parameter "%1$s" for configuration not available', "project" ), parent::ERR_TEMP );
		}

		$this->_appendChildCDATA( 'id', $invoice->getId(), $dom, $orderitem );
		$this->_appendChildCDATA( 'type', $invoice->getType(), $dom, $orderitem );
		$this->_appendChildCDATA( 'datetime', $pdate, $dom, $orderitem );

		if ( $invoice->getRelatedId() != null ) {
			$this->_appendChildCDATA( 'relatedid', $invoice->getRelatedId(), $dom, $orderitem );
		}

		$this->_appendChildCDATA( 'customerid', $base->getCustomerId(), $dom, $orderitem );
		$this->_appendChildCDATA( 'projectcode', $config['default.project'], $dom, $orderitem );
		$this->_appendChildCDATA( 'languagecode', strtoupper( $base->getLocale()->getLanguageId() ), $dom, $orderitem );
		$this->_appendChildCDATA( 'currencycode', $base->getPrice()->getCurrencyId(), $dom, $orderitem );
	}