What is the simplest way of dumping Tridion component content (based on a given schema, i.e.: non-arbitrary) into XML using modular template?
Specifically, need to pass component's content to/as ASP.Net custom control, that is, something like:
<custom:MyControl runat="server"
TextField="value1"..>
<EmbeddedField>
..
</EmbeddedField>
</custom:MyControl>
I see one possible way would be to tweak Default Dreamweaver Component Design DWT TBB, but that seems to be too laborious.
EDIT
Another murky subject was the second part of the question above: embedding XML into ASP.Net control markup. The problem is that XML needs to be escaped. The following brainteaser does it in a DWT (pressuming, that Nuno's TBB wrote into Output):
<custom:MyControl runat="server">
<xml>
@@(Output).replace(RegExp.call(null, /&/.toString()[1], "g"), '&').replace(RegExp.call(null, /</.toString()[1], "g"), '<').replace(RegExp.call(null, />/.toString()[1], "g"), '>').replace(RegExp.call(null, String.fromCharCode(34), "g"), '"')@@
</xml>
</custom:MyControl>
(All that ado is only necessary to overcome DWT's arcane JS escaping rules.)