This is what I have as final code. I'm sure there are things that could be tweaked, but I will work on that.
I added 2 functions to xs2ml for placing static text into nodes, and I created the rest of the code in xs2ml_usage to complete the xml.
Thanks again for all your help!!