title: Reading from XML file to ListView- Windows Phone bible App
body: <p>I am new to windows phone in visual studio 2012 and I would like to build a bible app in my native african language. I'm having a problem with reading Book Title, Chapter and verse from an xml file and to display in a ListView. Here is what I have done. Please help.</p>
  
  <h1>XML FIlE</h1>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  
  &lt;bible translation="King James Version"&gt;
    &lt;testament name="Old"&gt;
      &lt;book name="Genesis"&gt;
        &lt;chapter number="1"&gt;
          &lt;verse number="1"&gt;In the beginning God created the heaven and the earth.&lt;/verse&gt;
          &lt;verse number="2"&gt;And the earth was without form, and void; and darkness was upon the face of     the deep. And the Spirit of God moved upon the face of the waters.&lt;/verse&gt;
        &lt;/chapter&gt;
      &lt;/book&gt;
    &lt;/testament&gt;
  &lt;/bible&gt;
  </code></pre>
  
  <h1>C# CODE</h1>
  
  <pre><code>namespace BibleApp
  {
      public partial class MainPage : PhoneApplicationPage
      {
          // Constructor
          public MainPage()
          {
              InitializeComponent();
  
              XDocument loadedData = XDocument.Load("Bible.xml");
              var SearchData = from c in loadedData.Descendants("testament").Descendants("book").Descendants("chapter").Descendants("verse")
                               where (bool)c.Parent.Parent.Parent.Attribute("name")
                               where (bool)c.Parent.Parent.Attribute("name")
                               where (bool)c.Parent.Attribute("number")
                               select new BibleLoad
                               {
                                   VerseNumber = (string)c.Attribute("number"),
                                   BibleText = (string)c.Value.ToString(),
                                   TheFontSize = FontSize
                               };
              TheList.ItemsSource = SearchData;
              TheList.Visibility = Visibility.Visible;
  
              // Sample code to localize the ApplicationBar
              //BuildLocalizedApplicationBar();
          }
  
          public class BibleLoad
          {     
              string myTestament;
              string myBook;
              string myChapter;
              string myVerse;
              double fontSize;
              string bibleText;  
  
              public string Testament
              {
                  get { return myTestament; }
                  set { myTestament = value; }
              }
  
              public string Book
              {
                  get { return myBook; }
                  set { myBook = value; }
              }
  
              public string Chapter
              {
                  get { return myChapter; }
                  set { myChapter = value; }
              }
  
              public string VerseNumber
              {
                  get { return myVerse; }
                  set { myVerse = value; }
              }
  
              public double TheFontSize
              {
                  get { return fontSize; }
                  set { fontSize = value; }
              }
  
              public string BibleText
              {
                  get { return bibleText; }
                  set { bibleText = value; }
              }
          }
      }
  }
  </code></pre>