This is not a big problem. One way is suggested to use recursion. Another way is that you can make your own Stack.
Push and pop are the operations of a Stack. When you insert a value in stack it is push and when you fetch the value from stack it is pop. the basic concept of a stack is First in Last out.
Please don’t say that you can not make a program of these operation. If you are doing such programming then you must aware about stack.
Another thing you would need is File handling in case you use real mark up files. For mark up language, You can see any web page. Basi markup language is HTML.
Feel free to revert back if still has confusion.