Please Help Creating Variants

for my addon last step. i try since 2 days.

o have some values in for each


<br />
foreach($xmlD->Variants as $value)<br />
{<br />
<br />
$ozel = $value->variant->__toString();<br />
$deg = $value->value->__toString();<br />
<br />
}<br />

```<br />
<br />
i can print them with echo i try alot of combinations . but still nothing.<br />
<br />
how can i create variants if not there and adding value this variants? ? ?