Title: Export Images as Nested Elements
Last modified: June 15, 2022

---

# Export Images as Nested Elements

 *  Resolved [z1pas](https://wordpress.org/support/users/z1pas/)
 * (@z1pas)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/export-images-as-nested-elements-2/)
 * Hi,
 * I’m creating an XML feed, using the custom XML format, that need to list images
   like this:
 *     ```
       <images>
       	<image>
       		<url>http://domain.com/imagefile.jpg</url>
       	</image>
       </images>
       ```
   
 * There doesn’t seem to be a way to do this using the XML Editor, so I’ve taked
   a custom function and tried to modify it which looks like this:
 *     ```
       function image( $url = null) {
       	$i = 1;
       	$output = '';
       	foreach ( $url as $image ) {
       		$output .= '**LT**image id="' . $i . '"**GT**';
       		$output .= '**LT**url**GT**' . $image . '**LT**/url**GT**';
       		$output .= '**LT**/image**GT**';
       		$i++;
       	}
       	return $output;
       }
       ```
   
 * But with this function I get only one result which looks like this:
 *     ```
       <images>
       	<image id="1">
       		<url>http://domain.com/imagefile.jpg</url>
       	</image>
       </images>
       ```
   
 * Any help to get this working as needed would be greatly appreciated.
 * Thank you,
    Aleksandr
    -  This topic was modified 3 years, 11 months ago by [z1pas](https://wordpress.org/support/users/z1pas/).
    -  This topic was modified 3 years, 11 months ago by [z1pas](https://wordpress.org/support/users/z1pas/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/export-images-as-nested-elements-2/#post-15762320)
 * Hi [@z1pas](https://wordpress.org/support/users/z1pas/),
 * Since this is regarding a Pro feature, please contact us here: [http://www.wpallimport.com/support/](http://www.wpallimport.com/support/).
   We can only help with the free plugin on this forum.

Viewing 1 replies (of 1 total)

The topic ‘Export Images as Nested Elements’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-export/assets/icon-256x256.png?rev=2570162)
 * [WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel](https://wordpress.org/plugins/wp-all-export/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-export/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-export/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-export/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-export/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-export/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/export-images-as-nested-elements-2/#post-15762320)
 * Status: resolved