Relationships between nodes

Hi all,
I’m struggling to work out how to extract either OSM or shapefile (tried both) with relationships preserved, e.g.:
Way 4972913 is connected to nodes x,y,z etc.
I’m looking to recreate links between the stations (and railways) and this is essential for the project. I’ve looked at quite a couple OSM datasets and no luck so far…maybe you know of one which does have it?
Any help would be appreciated

When you open and scroll down the left side to the bottom there is an option to download the xml. This is a link to the API call which retrieves the way data:
Hope this helps.