title: How Can I Save A XML Data Model Implemented In a ListView In QML for Blackberry 10?
body: <p>Im doing a list view with a XMLDatamodel and i trying to save data in my xml file because i want to keep safe this information after the aplication closes.</p>
  
  <p>I just want to save the text on textarea in "body" of my xml file  when the button below is clicked. 
  or is better use a JSON file or a Arraydatamodel?</p>
  
  <p>this is my QML file:</p>
  
  <pre><code>import bb.cascades 1.2
  
  Page {
      Container {
          ListView {
              dataModel: XmlDataModel {
                  source: "Data.xml"
              }
              listItemComponents: [
                  ListItemComponent {
                          Header {
                              title: ListItemData.title
                          }                       
                  },
                  ListItemComponent {
                      type: "body"
                      Label {
                          text: ListItemData.title
                      }
                  }              
              ]
          }
  
          TextArea {
              id: nameField
              hintText: "Text To Save in body of XML file"
              preferredHeight: 140
              horizontalAlignment: HorizontalAlignment.Fill
          }
  
          Container {
              horizontalAlignment: HorizontalAlignment.Center
              Button {
                  text: "ADD"
                  onClicked: {
  
                      //SAVE THE TEXT IN TEXTAREA TO A DATA.XML 
                  }
              }//end of button
          } // end of Container
      }//end of container
  }//end of page
  </code></pre>
  
  <p>And this is my XML File "Data.xml"</p>
  
  <pre><code>&lt;root&gt;
      &lt;header title="NOTE 1"/&gt;
          &lt;listItem title="THIS IS A BODY OF NOTE 1"/&gt;
  
      &lt;header title="NOTE 2"/&gt;
          &lt;listItem title="THIS IS A BODY OF NOTE 2"/&gt;
  
  &lt;/root&gt;
  </code></pre>
  
  <p>Please Help Me. Thank You So Much :D . </p>