code: function _addInstanceIdNodeIfMissing( doc ) {
      const xformsPath = '/xmlns:root/xmlns:model/xmlns:instance/*/xmlns:meta/xmlns:instanceID';
      const openrosaPath = '/xmlns:root/xmlns:model/xmlns:instance/*/orx:meta/orx:instanceID';
      const instanceIdEl = doc.get( `${xformsPath} | ${openrosaPath}`, NAMESPACES );
  
      if ( !instanceIdEl ) {
          const rootEl = doc.get( '/xmlns:root/xmlns:model/xmlns:instance/*', NAMESPACES );
          const metaEl = doc.get( '/xmlns:root/xmlns:model/xmlns:instance/*/xmlns:meta', NAMESPACES );
  
          if ( metaEl ) {
              metaEl
                  .node( 'instanceID' );
          } else if ( rootEl ) {
              rootEl
                  .node( 'meta' )
                  .node( 'instanceID' );
          }
      }
  
      return doc;
  }
docs: Temporary function to add a /meta/instanceID node if this is missing.
  This used to be done in enketo-xslt but was removed when support for namespaces was added.
  
  @param {[type]} doc libxmljs object