I am preparing my own xml feed for one client. I want to add attributes to output xml feed.
<images>
<photo id="1">
<url>http://www.xyz.com/wp-content/uploads/wpp_import_files/1/1683/739192434.jpg</url>
</photo>
</images>
in array, i have passed like below code, but it doesn't work
$images['photo'] = array('@attributes'= array('id'=>'1'));
$images['photo']['url'] = 'http://www.xyz.com/wp-content/uploads/wpp_import_files/1/1683/739192434.jpg';
But output comes in below wrong xml format
<images>
<photo>
<property>
<id>1</id>
</property>
<url>http://www.xyz.com/wp-content/uploads/wpp_import_files/1/1683/739192434.jpg</url>
</photo>
</images>
Any ideas how to add attributes?