         let elementName = elementName.upperFirst()
         let node = XMLNode(elementName: elementName)
         node.attributes = attributeDict
+        
+        currentNodeIsArray = lastElementName == elementName
         
         if nodeTree == nil {
             nodeTree = node

    public func parser(_ parser: XMLParser, foundCharacters string: String) {
        let string = string.trimmingCharacters(in: .whitespacesAndNewlines)
        if !string.isEmpty && string != "\"" {
            currentNode?.values.append(string)
        }
    }
    

    
    private var lastElementName: String?
    
    private var currentNodeIsArray = false
    
    public init(data: Data) {
        self.parser = XMLParser(data: data)
        super.init()
