Find Text before a Tag : <p>I have a text in a XML File Link Below</p>

<pre><code>&lt;p&gt;The artificial and industrial uses &lt;xref&gt;1989&lt;/xref&gt; of microorganisms for material production have a long history of more than a thousand years. Recently, genetic operations have been widely applied to improve production. Two generally considered &lt;xref&gt;approaches, 2017&lt;/xref&gt; introduce enzymes that have higher activities from other organisms or species and introduce enzymes to realize metabolic pathways that do not naturally occur in the microorganisms. The former method is popular because its operation is simpler and improvements are more predictable than &lt;xref&gt;(2001)&lt;/xref&gt; with the latter method. &lt;xref&gt;2013&lt;/xref&gt; Conventional gene modifications using ultraviolet or other radiation types are easy to achieve and have been widely applied in many industries. Nevertheless, the efficiency of such improvements is quite low because gene modifications occur accidentally and uncontrollably, and progress is made serendipitously. Therefore, gene introduction is currently used along with conventional methods.&lt;/p&gt;
</code></pre>

<p>I need to get the text before all <code>&lt;xref&gt;</code> element in a <code>&lt;p&gt;</code> Element.</p>

<pre><code>var $element = $xml.find("p").addBack("p");
$element.each(function()
{
    //code here
});
</code></pre>

<p>Output like</p>

<pre><code>&lt;p&gt;The artificial and industrial &lt;u&gt;uses &lt;xref&gt;1989&lt;/xref&gt;&lt;/u&gt; of microorganisms for material production have a long history of more than a thousand years. Recently, genetic operations have been widely applied to improve production. Two generally &lt;u&gt;considered &lt;xref&gt;approaches, 2017&lt;/xref&gt;&lt;/u&gt; introduce enzymes that have higher activities from other organisms or species and introduce enzymes to realize metabolic pathways that do not naturally occur in the microorganisms. The former method is popular because its operation is simpler and improvements are more predictable &lt;u&gt;than &lt;xref&gt;(2001)&lt;/xref&gt;&lt;/u&gt; with the latter &lt;u&gt;method. &lt;xref&gt;2013&lt;/xref&gt;&lt;/u&gt; Conventional gene modifications using ultraviolet or other radiation types are easy to achieve and have been widely applied in many industries. Nevertheless, the efficiency of such improvements is quite low because gene modifications occur accidentally and uncontrollably, and progress is made serendipitously. Therefore, gene introduction is currently used along with conventional methods.&lt;/p&gt;
</code></pre>

<p>I browse lot regards find text before element but i didnt get solution. please suggest solution thanks in advance</p>
