using c# I have found either of the following are identical. Because I am submitting to sql I had to account for single ticks so I added a string replace
XPathNavigator root = CreateNavigator();
string myxml = root.OuterXml.Replace("'", "''");
string myIxml = root.InnerXml.Replace("'", "''");