     public var hashValue: Int { return 0 }
 
     /// Create a curried xpath finder with the given namespaces
-    public func xpath(ns: [String:String]? = nil)(_ path: String) throws -> [Node] {
+    public func xpath(ns: [String:String]? = nil, _ path: String) throws -> [Node] {
         return try rootElement.xpath(path, namespaces: ns)
     }
 

        var results = [Node]()
        let nodeSet = xpathObj.memory.nodesetval
        if nodeSet != nil {
            for var index = 0, count = Int(nodeSet.memory.nodeNr); index < count; index++ {
                let node = nodeSet.memory.nodeTab[index]
                if node != nil {
                    results += [Node(node: NodePtr(node), owns: false)]

    public var children: [Node] {
        get {
            var nodes = [Node]()
            var child = castNode(nodePtr).memory.children
            while child != nil {
                defer { child = child.memory.next }
                nodes += [Node(node: NodePtr(child), owns: false)]
            }
            return nodes
        }

        set(newChildren) {
            for child in children { child.detach() } // remove existing children from parent
            for child in newChildren { addChild(child) }
        }
    }

