               {:keys [xml-output-file]} (ss/process-xml
                                          {:xml-output-file (.toPath output-file-copy)
                                           :input input-files})
-              nodes (xpath-query (.toString xml-output-file) "/VipObject/StreetSegment")]
+              nodes (xpath-query (.toString xml-output-file) "/VipObject/StreetSegment")
+              nodes-as-maps (map #(into {} %) nodes)]
 
           (is (= 2 (count nodes)))
-          (is (= #{"p001" "p002"} (set (map :precinct-id nodes))))
-          (is (= #{"20001" "20002"} (set (map :zip nodes))))
-          (is (= #{"DC"} (set (map :state nodes))))
-          (is (= #{"Delaware" "Wisconsin"} (set (map :street-name nodes))))))
+          (is (= #{"p001" "p002"} (set (map :precinct-id nodes-as-maps))))
+          (is (= #{"20001" "20002"} (set (map :zip nodes-as-maps))))
+          (is (= #{"DC"} (set (map :state nodes-as-maps))))
+          (is (= #{"Delaware" "Wisconsin"} (set (map :street-name nodes-as-maps))))
+          (let [children-keys (->> nodes first (map first))]
+            (is (well-ordered-children? children-keys) (pr-str children-keys)))
+          (let [children-keys (->> nodes second (map first))]
+            (is (well-ordered-children? children-keys) (pr-str children-keys)))))
 
       (testing "Catches bad street segments, including those with missing
               required fields and non-existent precinct-ids"

        nodes (.evaluate xpath query-string isource XPathConstants/NODESET)]
    (->> (.getLength nodes)
         (range 0)
         (mapv #(street-segment-node->map (.item nodes %))))))

(defn copy-to-temp-file
  [resource-path]

   [javax.xml.xpath XPathFactory XPathConstants]
   [org.xml.sax InputSource]))

(defn conj-node-to-array
  [nodes a idx]
  (let [item (.item nodes idx)]
    (conj a [(xml-name->keyword (.getNodeName item)) (.getTextContent item)])))

(defn street-segment-node->array
  [node]
  (let [ss-nodes (.getChildNodes node)]
    (->> ss-nodes
         .getLength
         (range 0)
         (reduce (partial conj-node-to-array ss-nodes) []))))

(defn xpath-query
  [filepath query-string]
