What is the point of this? I don't see a situation where this would be a better choice over:
(1) XSLT (2) Regular programming language e.g. Java / .NET and use the XML libraries to build the document.
Also with the navigation e.g. UP; it looks hard to maintain.
I can imagine production code ending up with:
UP; UP; UP; UP; UP;
A simple change to the XML structure and this will break so easily.