Clay's option would work "if" you didn't save the file while you were working on it. The problem is that the Editor really doesn't care about line numbers. It pulls in the file and formats it on screen based on your stylesheet which throws your source position of any content out the window. Then when you save the file, the Editor simply lays down the file in defaultline lengths of 72 or less depending on word/tag breaking. Consequently, you could open the file, do nothing and save it right back and you could very well have a whole different set of line numbers for the file.
There is one thing you could do... Set the record length to "infinity" and no line in the file will be broken meaning tags will all be slammed to the left. Then you'd save the file. The lines would now be fairly consistent from edit to edit since the only variable would be that you add or delete content. Then with a routine that would read the lines like Clay mentioned.... Forget it! That's too much work just writing how to do it.
Point is, in an SGML Editor, lines in the source file are irrellavent. Everything is based on tags.
Hope this helps,