template <typename Object> void print(NodeList<Object>& L) { // print a NodeList NodeList<Object>::ObjectIterator iter = L.elements(); // element iterator while (iter.hasNext()) { // while more remain cout << iter.next() << " "; // print next/advance } }