I have a stored procedure in SQL Server 2016 that reads a XML file. What I would like to do is to skip saving an element if there is no value.

The XML element should look like something like this

```
<PROJECT_TERMSX>
      <TERM>Extramural Activities</TERM>
      <TERM>programs</TERM>
      <TERM>research facility</TERM>
</PROJECT_TERMSX>

```

but many of the elements are formed like

```
<PROJECT_TERMS xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />

```

My code to insert the data into a table is

```
INSERT into ADMIN_ExPORTER_TERMS (APPLICATION_ID, TERM)
    SELECT
        APPLICATION_ID,
        nref.value('.','varchar(max)') TERM                     
    FROM 
        [ADMIN_Exporter_Files_XML] 
    CROSS APPLY
        XMLData.nodes('//PROJECT_TERMSX/TERM') AS R(nref)
    WHERE
        APPLICATION_ID = @APPLICATION_ID

```

I would like to skip the elements that has the http Schema but don't know how to structure the code. I have no control over the original XML structure.