fix me up into add_child
fix simplexmlelement array cast

SimpleXML will implicitly convert string nodes to actual strings when
the parent node is casted to an array. It will only do this for top
level nodes. A test has been provided.