h1. Setting the XML in a NokogiriDatastream from a file h2. Setting the Datastream's XML We will make this smoother soon, but right now you have to manually parse your new xml as a Nokogiri XML Document and then put the Nokogiri Document in the datastream's ng_xml attribute. Example (you will have to change the path to point to the xml file you want)
my_path = "../om/spec/fixtures/mods_articles/hydrangea_article1.xml"
f = File.new(my_path)
xml = Nokogiri::XML::Document.parse(f)
ha = HydrangeaArticle.new
ha.datastreams["descMetadata"].to_xml
ha.datastreams["descMetadata"].ng_xml = xml
ha.datastreams["descMetadata"].to_xml
h2. Saving the Datastream In order to make sure that your updated datastream is saved to fedora, call .save _on the datastream_. If you call .save on the _object_, the changes you've made to the datastream might not be saved.
ha.datastreams["descMetadata"].save