[(continued from previous conversation)](https://github.com/tbudurovych/SmartFormat.NET/commit/afada22c9d98d8bf05d7eca715c5afab17c9b952#commitcomment-6227021)
The purpose of a `Source` plugin is just to resolve values.  Here, it looks like you've implemented some logic that would be better suited for a `Formatter` plugin. 

So I would suggest refactoring this plugin to JUST resolve the XML nodes, and return the actual node / nodes (as a single XElement or an array of them).
Then, you could implement a `Formatter` plugin that intelligently decides how to format an `XElement`, by either using `.Value` or `.ToString()` or some other customized logic.