diff --git a/Sources/XmlElement.swift b/Sources/XmlElement.swift index c9271f2..c6924c4 100644 --- a/Sources/XmlElement.swift +++ b/Sources/XmlElement.swift @@ -15,8 +15,11 @@ open class XmlElement { open var children: [XmlElement] = [] open var parent: XmlElement? - public init(name: String) { + public init(name: String, xmlns: String? = nil) { self.name = name + if let xmlns = xmlns { + attributes["xmlns"] = xmlns + } } open var xml: String {