title: How to add contents into the xml element?
body: <p>I need to insert a word <code>sqrt</code>(plain text without tags ) in the xml element of <code>m:msqrt</code> like below:</p>
  
  <p><img src="https://i.stack.imgur.com/tnxcW.jpg" alt="enter image description here"></p>
  
  <p>I tried:</p>
  
  <pre><code>var path = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/');
  //path of active document(sample.indd)
  
  var xmlPath = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/')+"/with_aid2.xml";
  
  xmlFile = File (xmlPath);
  
  if(xmlFile.exists){
      xmlFile.open();
      var myString = xmlFile.read();
      xmlFile.close();
      myXml = new XML ();
      myXml = XML(myString);
      var msqrtCount = myXml.xpath("//m:msqrt");
  
  }else{alert(xmlPath+" doesn't exist!");}
  
  for(var i=0;i&lt;msqrtCount.length();i++){  
      var added =    msqrtCount[i];
      added.contents="sqrt";       
  }
  </code></pre>
  
  <p>I get an error says invalid content property. </p>