title: substring-after and substring-before with an element instead of a string
body: <p>is it possible to use substring-before and substring-after with an element as a selector? If not, how would you do it?</p>
  
  <p>If I have this snippet for example, </p>
  
  <pre><code>&lt;root&gt;
      &lt;element&gt;This is an example. Some text here | and some text there&lt;/element&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I could use substring-before or substring-after and the pipe | to get the text on the left or right side</p>
  
  <pre><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="xs"
  version="2.0"&gt;
  
  &lt;xsl:template match="root"&gt;          
      &lt;element&gt;&lt;xsl:value-of select="substring-before(element, '|')"/&gt;&lt;/element&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>to get </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;element1&gt;This is an example. Some text here &lt;/element1&gt;
  </code></pre>
  
  <p>But how could I do that with an element dividing the text, like a lb or alt?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;root&gt;
      &lt;element&gt;This is an example. Some text here &lt;alt type="divider"/&gt; and some text there&lt;/element&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I was thinking about something with sibling, but I dont want to return a element but the string. So I can't really wrap my head around it.</p>
  
  <p>Thank you in advance!</p>