Changed AsXml to return an XElement instead of a string