xPath error

#13205

I have the following xml:

[color=blue:67475ee949]<ns0:Sample xmlns:ns0=\”http://BizTalkOrch.InPutSchema\”>
<Body>
<AnyThing>AnyThing_0</AnyThing>
</Body>
</ns0:Sample>[/color:67475ee949]

This message is assigned to message variable InMsg.
I have a variable called xmlDoc of type System.xml.xmldocument
I have another message of type System.xml.xmldocument called OutMsg

I am using xPath to extract some of InMsg message details:
my xpath expression is:

[color=darkred:67475ee949]xDoc = new System.Xml.XmlDocument();
xDoc= xpath(InMsg, \”//*[local-name()=’Body’][0]\”);
OutMsg=xDoc;[/color:67475ee949]

When I execute this and check it the Debug mode tracked events:

I get the following error:

[color=red:67475ee949]Microsoft.XLANGs.Core.NullPartException: The part ‘part’ of message ‘OutMsg’ contained a null value at the end of the construct block[/color:67475ee949].
at Microsoft.XLANGs.Core.Part.ConstructionCompleteEvent()
at Microsoft.XLANGs.Core.XMessage.ConstructionCompleteEvent()
at BizTalkOrch1.XPath.segment1(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Microsoft.XLANGs.Core.NullPartException
Scoped@
XPath.XPath
9363d962-4b5b-4fda-b012-74d2e73cf154

I feel something is wrong in my xPath statment. Please help If you can suggest some thing better.