Jak usunąć obiekt SimpleXMLElement z tablicy php

Przeczytałem plik XML używającsimplexml_load_file funkcja php.

Przechowuję dane xml w tablicy php, ale w jakiejś tablicy jej tablicę wyświetlania xmllike SimpleXMLElement Object ( [0] => some value )

Gdy drukuję dane xml, jego wyświetlanie jest prawidłowe, ale gdy przypiszę wartość xml do tablicy php, jej wyświetlanie jak powyżej obiektu xml w tablicy

XML

<data>
    <request>
        <type>City</type>
        <query>Anand, India</query>
    </request>
    <current_condition>
        <observation_time>08:55 AM</observation_time>
        <temp_C>28</temp_C>
        <temp_F>82</temp_F>
        <weatherCode>113</weatherCode>            
        <weatherDesc>Sunny</weatherDesc>
        <windspeedMiles>9</windspeedMiles>
        <windspeedKmph>14</windspeedKmph>
        <winddirDegree>63</winddirDegree>
        <winddir16Point>ENE</winddir16Point>
        <precipMM>0.0</precipMM>
        <humidity>23</humidity>
        <visibility>10</visibility>
        <pressure>1014</pressure>
        <cloudcover>0</cloudcover>
    </current_condition>
        <weather>
            <date>2012-12-22</date>
            <tempMaxC>33</tempMaxC>
            <tempMaxF>91</tempMaxF>
            <tempMinC>18</tempMinC>
            <tempMinF>64</tempMinF>
            <windspeedMiles>11</windspeedMiles>
            <windspeedKmph>17</windspeedKmph>
            <winddirection>ENE</winddirection>
            <winddir16Point>ENE</winddir16Point>
            <winddirDegree>63</winddirDegree>
            <weatherCode>113</weatherCode>
            <weatherDesc>Sunny</weatherDesc>
            <precipMM>0.0</precipMM>
        </weather>
        <weather>
            <date>2012-12-23</date>
            <tempMaxC>34</tempMaxC>
            <tempMaxF>92</tempMaxF>
            <tempMinC>18</tempMinC>
            <tempMinF>65</tempMinF>
            <windspeedMiles>9</windspeedMiles>
            <windspeedKmph>15</windspeedKmph>
            <winddirection>ENE</winddirection>
            <winddir16Point>ENE</winddir16Point>
            <winddirDegree>64</winddirDegree>
            <weatherCode>113</weatherCode>
            <weatherDesc>Sunny</weatherDesc>
            <precipMM>0.0</precipMM>
        </weather>
        <weather>
            <date>2012-12-24</date>
            <tempMaxC>33</tempMaxC>
            <tempMaxF>92</tempMaxF>
            <tempMinC>18</tempMinC>
            <tempMinF>64</tempMinF>
            <windspeedMiles>9</windspeedMiles>
            <windspeedKmph>14</windspeedKmph>
            <winddirection>NE</winddirection>
            <winddir16Point>NE</winddir16Point>
            <winddirDegree>45</winddirDegree>
            <weatherCode>113</weatherCode>
            <weatherDesc>Sunny</weatherDesc>
            <precipMM>0.0</precipMM>
        </weather>
    </data>

PHP:

$child=$xml->children();
foreach($xml->children() as $child)
{               
    foreach($child->children() as $child_t)
    { 
        $weather_arr[$child_t->getName()]=$child_t;
        echo $child_t->getName() . ": " . $child_t . "<br />";   

    }
}

echo "<pre>".html_entity_decode(print_r($weather_arr,true))."</pre>";

questionAnswers(2)

yourAnswerToTheQuestion