For sure. I'm just using XML literals in the example because it looks cool. But I'm also using this for a client job, and it's producing JSON.
It's not nearly as powerful as the real Sinatra, but it saves me the shenanigans of warbling Sinatra apps for servlet deployment.
If it doesn't provide any option for separation that is bad, but for micro services it can be really nice.