Opennebula API Parsing returned string XML RPC

Hello Guys,

Looking for some assitance on parsing the returned strings via the XMLRPC API.
I can send the XML data and the desired options are working fine.
I am using PHP server side as thats the backend for the control panel.

I get the data back but I am finding it hard to parse the return data as its all dumped into a string and not very well formatted.
For example here is a dump I get back from looking at the showback records I retrieve these by posting the following XML to the RPC endpoint:

XML posted to RPC on sunstone

[“SOMEUSER:SOMEPASSWORD”,-2,1,2018,-1,-1]

The method I am using is: one.vmpool.showback

Showback returns the following, I ideally want a way of identifying the bits I need and assigning them to variables so I can work with them, I can do this I just need a way of Parsing the bellow string, stripping the charecters doesn’t seem to help too much either.

<?xml version="1.0" encoding="UTF-8"?> 1 <SHOWBACK_RECORDS><SHOWBACK><VMID>0</VMID><VMNAME>Ubuntu 14.04 - KVM-0</VMNAME><UID>157</UID><GID>255</GID><UNAME>VLAN-210</UNAME><GNAME>VLAN-210</GNAME><YEAR>2018</YEAR><MONTH>4</MONTH><CPU_COST>0</CPU_COST><MEMORY_COST>0</MEMORY_COST><DISK_COST>0</DISK_COST><TOTAL_COST>0</TOTAL_COST><HOURS>0.29</HOURS></SHOWBACK><SHOWBACK><VMID>7</VMID><VMNAME>Ubuntu 14.04 - KVM-7</VMNAME><UID>157</UID><GID>255</GID><UNAME>VLAN-210</UNAME><GNAME>VLAN-210</GNAME><YEAR>2018</YEAR><MONTH>4</MONTH><CPU_COST>0</CPU_COST><MEMORY_COST>0</MEMORY_COST><DISK_COST>0</DISK_COST><TOTAL_COST>0</TOTAL_COST><HOURS>49.49</HOURS></SHOWBACK><SHOWBACK><VMID>11</VMID><VMNAME>Ubuntu 14.04 - KVM-11</VMNAME><UID>157</UID><GID>255</GID><UNAME>VLAN-210</UNAME><GNAME>VLAN-210</GNAME><YEAR>2018</YEAR><MONTH>4</MONTH><CPU_COST>0.15</CPU_COST><MEMORY_COST>0.07</MEMORY_COST><DISK_COST>0.32</DISK_COST><TOTAL_COST>0.54</TOTAL_COST><HOURS>48.57</HOURS></SHOWBACK><SHOWBACK><VMID>17</VMID><VMNAME>VLAN-210</VMNAME><UID>157</UID><GID>255</GID><UNAME>VLAN-210</UNAME><GNAME>VLAN-210</GNAME><YEAR>2018</YEAR><MONTH>4</MONTH><CPU_COST>0.00</CPU_COST><MEMORY_COST>0.00</MEMORY_COST><DISK_COST>0.00</DISK_COST><TOTAL_COST>0.00</TOTAL_COST><HOURS>0.03</HOURS></SHOWBACK><SHOWBACK><VMID>18</VMID><VMNAME>VLAN-210</VMNAME><UID>157</UID><GID>255</GID><UNAME>VLAN-210</UNAME><GNAME>VLAN-210</GNAME><YEAR>2018</YEAR><MONTH>4</MONTH><CPU_COST>0.14</CPU_COST><MEMORY_COST>0.07</MEMORY_COST><DISK_COST>1.69</DISK_COST><TOTAL_COST>1.89</TOTAL_COST><HOURS>46.05</HOURS></SHOWBACK><SHOWBACK><VMID>109</VMID><VMNAME>Ubuntu 14.04 - KVM-109</VMNAME><UID>157</UID><GID>255</GID><UNAME>VLAN-210</UNAME><GNAME>VLAN-210</GNAME><YEAR>2018</YEAR><MONTH>5</MONTH><CPU_COST>0.00</CPU_COST><MEMORY_COST>0.00</MEMORY_COST><DISK_COST>0.00</DISK_COST><TOTAL_COST>0.00</TOTAL_COST><HOURS>0.28</HOURS></SHOWBACK></SHOWBACK_RECORDS> 0