XAML readers expose a lot of useful information about the resultant XAML node stream, so you can do a whole lot more than just blindly write the nodes into some other form, such as morphing the content during the transformation.
The most important
XamlReader property to inspect when writing a custom node loop is
NodeType, which can be one of eight enumeration values:
StartObject—The reader is positioned at the start of an explicit object, such as an element’s start tag in XML or the beginning of a markup extension in a property value.
GetObject—The reader is positioned at the start of an implicit object, such as a collection whose ...