StringReader sr = new StringReader(@"
    <Canvas xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>
        <Rectangle Width='30' Height='100' Fill='Red' />
    </Canvas>");
XmlTextReader xr = new XmlTextReader(sr);

Canvas tree = (Canvas) XamlReader.Load(xr);

