How would I list all entries regardless of section or structure?
Actually your code should work just fine. But by default only 100 entries are fetched, maybe you need to increase the limit:

{% set entries = craft.entries.section().limit(null) %}


But if you just want to create a Sitemap, try Ben Croker's Sitemap-Plugin (I really like it)