How to use XmlReaderSettings with XmlReader in asp.net Xml

XmlReaderSettings with XmlReader
XmlReaderSettings.aspx

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Xml" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e)
    {
        string xmlFile = Request.PhysicalApplicationPath + @"App_Data\ITBookStore.xml";
        XmlReaderSettings settings = new XmlReaderSettings();
        settings.IgnoreComments = true;
        settings.IgnoreWhitespace = true;
        try
        {
            using (XmlReader reader = XmlReader.Create(xmlFile, settings))
            {
                string xmlContent;
                while (reader.Read())
                {
                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        xmlContent = "";
                        if(reader.Name == "book")
                        {
                            if (reader.HasAttributes)
                            {
                                xmlContent += reader.GetAttribute("ID").ToString() + "| ";
                            }
                        }
                        if (reader.Name == "name")
                        {
                            xmlContent += "<b>" + reader.ReadString().ToString() + "</b><br />";
                        }
                        if (reader.Name == "author")
                        {
                            xmlContent += "    <i>" + reader.ReadString().ToString() + "</i><br />";
                        }
                        if(reader.Name == "price")
                        {
                            xmlContent += "     $" + reader.ReadString().ToString() + "<br /><br />";
                        }
                        Label1.Text += xmlContent;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            Label1.Text = "An Error Occured: " + ex.Message;
        }
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>XmlReaderSettings: How to use XmlReaderSettings with XmlReader in asp.net Xml</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Navy; font-style:italic;">XML Example: XmlReader and XmlReaderSettings</h2>
        <asp:Label 
             ID="Label1"
             runat="server"
             Font-Bold="false"
             ForeColor="OrangeRed"
             Font-Size="Large"
             Font-Names="Comic Sans MS"
             >
        </asp:Label>
    </div>
    </form>
</body>
</html>
ITBookStore.xml

<?xml version="1.0" encoding="utf-8" ?>
<!-- This is a sample XML file for various XML example-->
<books>
  <book ID="1">
    <name>Adobe Flex 3: Training from the Source</name>
    <author>Jeff Tapper</author>
    <price>47.99</price>
    <type>Flex</type>
    <image>AdobeFlex3.jpeg</image>
  </book>
  <book ID="2">
    <name>Styling Web Pages with CSS</name>
    <author>Tom Negrino</author>
    <price>15.99</price>
    <type>CSS</type>
    <image>CSS.jpeg</image>
  </book>
  <book ID="3">
    <name>Adobe Flash CS4 Professional</name>
    <author>Mark Schaeffer</author>
    <price>19.99</price>
    <type>Flash</type>
    <image>FlashCS4.jpeg</image>
  </book>
</books>
Related asp.net example