Thanks Dino,
Going the other way (I know I didn't mention this) doesn't seem as elegant.
Is there a better way than this?
// slightly paraphrased
Stream stream = new MemoryStream();
new XmlSerializer( typeof(MyObject) ).Serialize( stream, myObject );
stream.Seek( 0, SeekOrigin.Begin );
XmlDocument doc = new XmlDocument();
doc.Load( stream );
return doc.DocumentElement;
Thanks again,
Brad
"Dino Chiesa [MSFT]" <di****@microsoft.com> wrote in message
news:OI**************@TK2MSFTNGP09.phx.gbl...
System.Xml.Serialization.XmlSerializer.Deserialize ()
accepts an XmlReader.
http://msdn.microsoft.com/library/en...lizeTopic3.asp
and you can create a System.Xml.XmlNodeReader from a System.Xml.XmlNode
http://msdn.microsoft.com/library/en...sctorTopic.asp
"Brad Quinn" <br********@yahoo.com> wrote in message
news:eF**************@TK2MSFTNGP10.phx.gbl... Lets say I have an XmlNode that validates against some schema. I also
have a class that was generated by the xsd tool using said schema.
What is the best way to get from an XmlNode to an instance of the class?