         node = parent
       return path
 
+    getChildNodes: (node) ->
+      if node.hasAttribute and node.hasAttribute('data-xmlel')
+        children = []
+        remaining = []
+        for child in node.childNodes
+          remaining.push child
+        while child = remaining.shift()
+          if child.hasAttribute and child.hasAttribute('data-xmlel')
+            children.push child
+          else
+            if child.childNodes and child.childNodes.length
+              for grandchild in child.childNodes
+                remaining.unshift grandchild
+        return children
+
+      return node.childNodes
 
     getNextSiblingElement: (node, tagName) ->
       node = node.nextSibling

        return node._localNameCache
      if typeof node is "string"
        return @getQname(node).local
      if node.localName isnt undefined
        return node._localNameCache = node.localName
      if node.local isnt undefined

      return node


    pathForNode: (node, root) ->
      while node.ownerElement?
        node = node.ownerElement
      path = []
      while parent = node.parentNode and parent isnt root
        index = 0
        if node.previousSibling
          sibling = node.previousSibling
