Fix Escape and Ampersand bug With addChild Method

The class `SimpleXMLElement` `addChild` method doesn't
protect against adding values with ampersand and escape characters to an xml node causing malforming xml. In order
to acheive that the child node need to be added first and
then assign the value.