title: Implement a envelope pattern in Marklogic using Xquery?
body: <p>I want to implement envelope pattern in my json data. My data looks like this </p>
  
  <pre><code>{
  "id": "1", 
  "first_name": "Shawn", 
  "last_name": "Grant", 
  "email": "sgrant0@51.la", 
  "country": "Liberia", 
  "ip_address": "37.194.161.124"
  }
  </code></pre>
  
  <p>I want to implement envelope pattern like this</p>
  
  <pre><code>{
  "envelope": { 
   "Code" : "2023"
  }, 
  "source": {
  "id": "1", 
  "first_name": "Shawn", 
  "last_name": "Grant", 
  "email": "sgrant0@51.la", 
  "country": "Liberia", 
  "ip_address": "37.194.161.124"
  }
  }
  </code></pre>
  
  <p>I tried the below xquery code but it didnt went well</p>
  
  <pre><code>xquery version "1.0-ml";
  let $doc := fn:collection("transform")
  for $i in $doc 
  let $object := json:object() --&gt; I am struck here because i dont know how to create a envelope header
  let $source := $i
  return $source
  </code></pre>
  
  <p>Any help is appreciated </p>
  
  <p>Thanks</p>