Not exactly, the xaml generates an object tree which can be persisted into a binary format, it can also be iterated to get objects that are keyed so they can be generated.
In terms of actually changing xaml into c#, you would really be better looking into generating C# from object graphs, this way you don't have to replicate xaml behavior, and can do: XAML -> Object graph -> C#.
You'll be able to get keys from the objects by using whatever class it is that xaml uses to determine keyd objects, which has overrides to detect class specified keys.
You'll have much more success using .NET 4, otherwise you'll need to depend on wpf assemblies and theres a certain amount of hard links in pre .net 4 xaml to wpf behavior.
If you don't want to use object graphs then you'll need to replicate some work that xaml does where it reflects the target member to determine how it handles value conversions etc.