These 2 lines below currently work within the XML document to produce the 2 values :
    if (isset($images[0]->fname)) { $image1 = $theimgpath.'/'.$images[0]->fname; } else  {   $image1 = ''; }
    if (isset($images[1]->fname)) { $image2 = $theimgpath.'/'.$images[1]->fname; } else { $image2 = ''; }
$image1     current value working = url within xml document require assignment to <image id="1">
$image2         current value = url working url within xml document require assignment to <image   id="2">
$output .= "<url>".$image1."</url>\n";         example of current working value 
Desired outcome the above working in code snippet currently working in the same xmldocument below:
`$output .= "<property>\n";
$id = $xml["id"];       
$id = $xml->image['id'];
$output .= $string = <<<XML
<images>
<image id="1"><url>id”1”</url></image>
<image id="2"><url>id”2”</url></image>
 </images>
 XML;
    $output .= "</property>";
}
$output .= "</root>";`
 
     
    