PHP Products export

I have PrestaShop XML module which exports products.

I want that my category_name, category_id and category_link would be in father. For example:

<categories>
<category_name></category_name>
<category_id></category_id>
<category_link></category_link>
</categories>

What I need to change in this code:

$xmlProduct = $this->document->createElement('product');
$xmlProduct->setAttribute('id', $xmlProductId);
$xmlProduct->appendChild($this->getCDATAElement('title', $xmlProductName));
$xmlProduct->appendChild($this->document->createElement('price', $xmlProductPrice));
$xmlProduct->appendChild($this->document->createElement('stock', $product['quantity']));
$xmlProduct->appendChild($this->document->createElement('product_url', $xmlProductUrl));
$xmlProduct->appendChild($this->document->createElement('category_id', $product['id_category_default']));
$xmlProduct->appendChild($this->getCDATAElement('category_name', $product['category']));
$xmlProduct->appendChild($this->document->createElement('category_link', $productProvider->getCategoryLink($product['id_category_default'], $product['category_rewrite'])));

I tried to change, but I don’t have enough knowledge in PHP to solve that.