There are a few different ways to do it but if you check out the
traversing nodes documentation article it shows how to traverse all the nodes, and also mentions the GetAllNodes() method. Your best bet will most likely be cycling through either all the nodes, or certain sections depending on what your structure is.