private function _arr2xml(XMLWriter $xmlW, array $data, $defaultTag = null)
    {
        foreach ($data as $key => $value) {
            if ($key === Resources::XTAG_ATTRIBUTES) {
                foreach ($value as $attributeName => $attributeValue) {
                    $xmlW->writeAttribute($attributeName, $attributeValue);
                }
            } elseif (is_array($value)) {
                if (!is_int($key)) {
                    if ($key != Resources::EMPTY_STRING) {
                        $xmlW->startElement($key);
                    } else {
                        $xmlW->startElement($defaultTag);
                    }
                }

                $this->_arr2xml($xmlW, $value);

                if (!is_int($key)) {
                    $xmlW->endElement();
                }
            } else {
                $xmlW->writeElement($key, $value);
            }
        }
    }