title: how to find the XML document size in MarkLogic
body: <p>I am trying to calculate the doc size of the XML in MarkLogic in part of performance. Could someone please help me with any inbuilt functions or any query where I can calculate my accurate size of the document? I have a formula like:</p>
  
  <pre><code>{string-length(string(data($doc))) idiv 2}
  </code></pre>