diff --git a/Sources/XMLParsing/XMLStackParser.swift b/Sources/XMLParsing/XMLStackParser.swift index 6aea4f6..912d595 100644 --- a/Sources/XMLParsing/XMLStackParser.swift +++ b/Sources/XMLParsing/XMLStackParser.swift @@ -163,7 +163,15 @@ internal class _XMLElement { for childElement in children { for child in childElement.value { if let content = child.value { - node[childElement.key] = content + if let oldContent = node[childElement.key] as? Array { + node[childElement.key] = oldContent + [content] + + } else if let oldContent = node[childElement.key] { + node[childElement.key] = [oldContent, content] + + } else { + node[childElement.key] = content + } } else if !child.children.isEmpty || !child.attributes.isEmpty { let newValue = child.flatten()