I can't quite do that as the level at which you choose to deploy is
arbitrary.
Do you mean that the highest level at which you could deploy to the
Compact Framework could be one of the child classes? Well, then I guess
you have to make the "CompactFramework" methods virtual, and trust the
inheriting child classes to override them only when they can, in fact,
deploy to the compact framework.
There can be several components (classes) in the same line of
inheritence that need to be deployed.
OK, now I'm confused again. I thought you said that along a single line
of inheritance, there was some base class that you were trying to find,
which was the one for which you wanted to call ToXml(). Now you're
saying that you may want to call ToXml() for several of the classes up
the hierarchy? Why would you do that when the highest-level one will
include the XML for all of the lower-level ones, and supposedly you're
deploying the most sophisticated control you can to the compact device?
Obviously I don't fully understand what you're trying to achieve.
And in addition, it isn't an aesthetically pleasing solution,
Aesthetics is in the eye of the beholder.

Me, I find messing around
in IL and using Reflection to play tricks aesthetically ugly.
I would much prefer to make the situation explicit in my interface:
this class can export to the Compact Framework / this class can't and
instead defers to its base class. In essence I see what you're trying
to do is to load two jobs into one method: Emit XML for the regular
framework and emit XML to deploy to the compact framework, and decide
which to do based on some funky Reflection / IL mashing... or am I not
getting what you're trying to do?
as the XML method would have to be implemented twice in the
deployable class.
Implemented? No, not at all. More like declared. The CompactFramework
versions would never have any more of a body that simply a call to the
corresponding "regular framework" version. Classes that can deploy to
the CF contain an overload. Those that can't, don't. The net effect is
that calling the CompactFramework version of the method will "search up
the hierarchy" until it finds the first class that can deploy to the
framework, and use that class's version of the method, which will
simply call that class's ToXml(). If that's not exactly what you want
to do, then please help me understand better.
Emiting IL is more complicated, but this I can do on my side, sparing
those that write the components to write redundant code.
Nobody has to write redundant code, unless you count three lines of
code in each class that can be deployed to the framework as being
"redundant".
One thing I certainly don't understand is how, if you're going to take
care of this "automagically" under the covers, are you going to figure
out which of the derived classes can be deployed to the framework (and
thus their ToXml() should be used) and which can't (and so you have to
keep searching up the hierarchy)?