Generating Structured Source Code with the help of XML tags is not new to research. Apparently, using a structured primary source for source code is. The post discusses about one of the major players of structured source code, srcML, and argues about why it may be good idea to store the source code in a structured fashion primarily.
Apache Felix is an implementation of the OSGi standard. It features a tutorial which I had a more detailed view on.