I am currently using the WPF RichTextBox control and want to be able to store the data as plain text with the images intact so it is searchable from our database.I have this code\[code\] RichTextBox box = sender as RichTextBox; TextRange tr = new TextRange(box.Document.ContentStart, box.Document.ContentEnd); using (MemoryStream ms = new MemoryStream()) { tr.Save(ms, DataFormats.Rtf); byte[] arr = ms.ToArray(); string rtf = Encoding.ASCII.GetString(arr); }\[/code\]Now I understand I can use several different DataFormat types. Xaml, XamlPackage, and Rtf. RTF gets us what we want but we have existing applications that need the data to be in XHTML or XML and maintain the images, so DataFormat.Xaml is no good. XamlPackage stores the data as binary and can't be searched on, so that isn't any good either.How can I get the data from the RichTextBox and save it with images inlined as XML or XHTML? anything but Rtf really. I'm trying not to write a Rtf-XHTML converter. We cannot use commercial solutions as we need access to the source code, because users needs change we need to be able to modify the solution to fit with our current goals.