Microsoft Exam Questions

Which two code segments can you use to achieve this goal?

Your Web site processes book orders. One of the application methods contains the following code segment.

XmlDocument doc=newXmlDocument();
doc.LoadXml("<book><discount>10</discount>" +"
<title>Dictionary</title></book>");

You need to remove the discount element from XmlDocument. Which two code segments can you use to achieve this goal?
(Each correct answer presents a complete solution. Choose two.)

A.
XmlNode root=doc.DocumentElement;root.RemoveChild(root.FirstChild);

B.
XmlNode root
=doc.DocumentElement;root.RemoveChild(root.SelectSingleNode("discount"));

C.
doc.RemoveChild(doc.FirstChild);

D.
doc.DocumentElement.RemoveChild(doc.FirstChild);