Saving the original XML inside your script file is easy; just use a here-string, like this:
$xml = @' <?xml version="1.0"?> <catalog> <book id="bk101"> <author>Gambardella, Matthew</author> <title>XML Developer's Guide</title> <genre>Computer</genre> <price>44.95</price> <publish_date>2000-10-01</publish_date> <description>An in-depth look at creating applications with XML.</description> </book> </catalog> '@
Comparing the files might be a little trickier. A quick web search turned up this StackOverflow post, which looks promising: http://stackoverflow.com/questions/13223765/compare-xml-structure-using-powershell