protected static function arrayToXML($data, &$xml = null){

            if($xml === null)
                $xml = new \SimpleXMLElement("<?xml version=\"1.0\"?><nondb></nondb>");
            foreach($data as $k=>$v){
                if(is_array($v)){
                    $sub = $xml->addChild("$k");
                    self::arrayToXML($v, $sub);
                }else{
                    $xml->addChild("$k", htmlspecialchars("$v"));
                }
            }

            return $xml->asXML();

        }