public void GetIndexOfNode()
{
//ExStart
//ExFor:CompositeNode.IndexOf
//ExSummary:Shows how to get the index of a given child node from its parent.
Document doc = new Document(MyDir + "Rendering.doc");
// Get the body of the first section in the document.
Body body = doc.FirstSection.Body;
// Retrieve the index of the last paragraph in the body.
int index = body.ChildNodes.IndexOf(body.LastParagraph);
//ExEnd
// Verify that the index is correct.
Assert.AreEqual(24, index);
}