Export ways of railway line

Hello everybody.

I would like to export data from a railway line. To work with this data afterwards, I need the different way-elements in a meaningful order according the railway line.
Is there a possibility or an other tool available with which I can export the way-elements with the same order like railway line is built or with an additional index?

I hope you understand my question. Sorry for limited english writing skills. Feel free to answer in german, if you’re mother language is german.