title: Problems with QtXQuery in qt 5.12.8
body: <p>I am trying to read xml tags from a document using QtXQuery. Works out fine besides a '\n'-char that is attached to each query-result. Moreover using the last()-statement on a collection returns the expected number of items in the collection with a trailing repetition + '\n'.
  <a href="https://stackoverflow.com/questions/52198868/why-qxmlquery-seem-to-add-a-n-to-results-and-how-to-solve-it">Why QXmlQuery seem to add a ` \n` to results? (and how to solve it?)</a> suggest to use a QStringList and only take the first item into account, yet this does not seem to work with my setup as using a QStringList on query.evaluateTo(&amp;qsl) fails to return any results. So: my question is if this is a bug in libqt5xmlPatterns5 or if my implementation is the reason for this behavior? Am I missing some details on how to use QtXmlQuery?
  So here is the piece of code:</p>
  <ol>
  <li><p>get_tag_value:</p>
  <pre><code>static lib_int_err_t get_tag_value(QString *result, QUrl schema_file, QString xml_file_name, QString var_name, QString query_str)
  {
      lib_int_err_t ret_code = LIE_OK;
      QFile *xml_f= new QFile(xml_file_name);
      xml_f-&gt;open(QIODevice::ReadOnly);
      if(result!=nullptr){
          result-&gt;clear();
          QXmlSchema xmlschema;
          // QStringList *results = new QStringList();
          xmlschema.load(schema_file);
          QXmlQuery query(QXmlQuery::XQuery10, xmlschema.namePool());
          query.bindVariable(var_name, xml_f);
          query.setQuery(query_str);
          query.evaluateTo(result);
          // result-&gt;append(results-&gt;first());
          ret_code = LIE_OK;
      }
      else{
          ret_code = LIE_XML_MALFORMED;
      }
      xml_f-&gt;close();
      return ret_code;
  
  }
  </code></pre>
  </li>
  <li><p>The input query string:</p>
  <pre><code>'declare copy-namespaces no-preserve, inherit; declare variable $&quot; + var_name + &quot; external; doc($&quot; + var_name + &quot;)&quot; + &quot;//procLib/last()&quot; '
  </code></pre>
  </li>
  <li><p>The schema used for data description:</p>
  <pre><code> &lt;xs:element name=&quot;toolConfig&quot;&gt;
       &lt;xs:complexType&gt;
           &lt;xs:sequence&gt;
               &lt;xs:element name=&quot;processingLibsSettings&quot;&gt;
                   &lt;xs:complexType&gt;
                       &lt;xs:sequence&gt;
                           &lt;xs:element name=&quot;interfaceSchemaDef&quot; type=&quot;xs:string&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
                           &lt;xs:element name=&quot;interfaceSchemaPath&quot; type=&quot;xs:string&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
                           &lt;xs:element name=&quot;processingLibsInstances&quot;&gt;
                               &lt;xs:complexType&gt;
                                   &lt;xs:sequence maxOccurs=&quot;unbounded&quot;&gt;
                                       &lt;xs:element name=&quot;procLib&quot; minOccurs=&quot;0&quot;&gt;
                                           &lt;xs:complexType&gt;
                                               &lt;xs:sequence&gt;
                                                   &lt;xs:element name=&quot;procLibConfigName&quot; type=&quot;xs:string&quot;/&gt;
                                                   &lt;xs:element name=&quot;procLibConfigPath&quot; type=&quot;xs:string&quot;/&gt;
                                                   &lt;xs:element name=&quot;procLibName&quot; type=&quot;xs:string&quot;/&gt;
                                                   &lt;xs:element name=&quot;procLibPath&quot; type=&quot;xs:string&quot;/&gt;
                                               &lt;/xs:sequence&gt;
                                           &lt;/xs:complexType&gt;
                                       &lt;/xs:element&gt;
                                   &lt;/xs:sequence&gt;
                               &lt;/xs:complexType&gt;
                           &lt;/xs:element&gt;
                       &lt;/xs:sequence&gt;
                   &lt;/xs:complexType&gt;
               &lt;/xs:element&gt;
               &lt;xs:element name=&quot;installDir&quot; type=&quot;xs:string&quot;/&gt;
           &lt;/xs:sequence&gt;
       &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
  </code></pre>
  </li>
  </ol>