When you use XML Source and check Output as Raw Option without selecting Convert to JSON option then you may get following error.
Unable to cast object of type 'Newtonsoft.Json.Converters.XmlDocumentWrapper' to type 'Newtonsoft.Json.Converters.IXmlElement'.
This error happens when your XML Fragment has attributes on the root node.
- Try to avoid hierarchy which produces attribute in the root node.
- Make sure Convert to JSON Option is check (Leaving it unchecked may cause this error). Later you can use JSON Parser Transform to parse those attributes downstream.