private function buildXml(array $array, \SimpleXMLElement &$xmlElem):\SimpleXMLElement
    {
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                if (!is_numeric($key)) {
                    $subnode = $xmlElem->addChild("$key");
                    $this->buildXml($value, $subnode);
                } else {
                    $subnode = $xmlElem->addChild("item$key");
                    $this->buildXml($value, $subnode);
                }
            } else {
                $xmlElem->addChild("$key", htmlspecialchars("$value"));
            }
        }
        return ($xmlElem);
    }