text>fgjh</text>
    </more>
</some>

What I want:
XML-File_111.xml
<some>
    <more status="1" att="q" status_id="111">
        <text>asdf</text>
    </more>
    <more status="2" att="c" status_id="111">
        <text>fdas</text>
    </more>
    <more status="2" att="a" status_id="111">
        <text>qwer</text>
    </more>
</some>

XML-File_222.xml
<some>
    <more status="1" att="w" status_id="222">
        <text>yxcv</text>
    </more>
    <more status="2" att="f" status_id="222">
        <text>vvbmn</text>
    </more>
    <more status="2" att="g" status_id="222">
        <text>fgjh</text>
    </more>
</some>

My XSLT so far:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<xsl:template match="/test">
    <xsl:for-each select="test/some/more">
        <xsl:result-document method="xml" href="file_{@status_id}.xml">
            <root>
                <xsl:copy-of select="//more[type = current()/status_id]/@*"/>
                <elem>
                    <xsl:copy-of select="../@* |." />
                </elem>
            </root>
        </xsl:result-document>
    </xsl:for-each>
</xsl:template>

But I'm not getting anywhere with it. I get only one empty XML-File. So I'm doing something totally wrong, but what?

A:

Typical
text > fgjh</text > 
     < /more > 
 < /some > 

 What I want: 
 XML-File_111.xml 
 < some > 
     < more status="1 " att="q " status_id="111 " > 
         < text > asdf</text > 
     < /more > 
     < more status="2 " att="c " status_id="111 " > 
         < text > fdas</text > 
     < /more > 
     < more status="2 " att="a " status_id="111 " > 
         < textbook > qwer</text > 
     < /more > 
 < /some > 

 XML-File_222.xml 
 < some > 
     < more status="1 " att="w " status_id="222 " > 
         < textbook > yxcv</text > 
     < /more > 
     < more status="2 " att="f " status_id="222 " > 
         < textbook > vvbmn</text > 
     < /more > 
     < more status="2 " att="g " status_id="222 " > 
         < text > fgjh</text > 
     < /more > 
 < /some > 

 My XSLT so far: 
 <? xml version="1.0 " encoding="UTF-8 "? > 
 < xsl: stylesheet xmlns: xsl="http://www.w3.org/1999 / XSL / Transform " 
 xmlns: xs="http://www.w3.org/2001 / XMLSchema " 
 exclude - solution - prefixes="xs " 
 version="2.0 " > 
 < xsl: template match="/test " > 
     < xsl: for - each select="test / some / more " > 
         < xsl: result - document method="xml " href="file_{@status_id}.xml " > 
             < root > 
                 < xsl: transcript - of select="//more[type = current()/status_id]/@*"/ > 
                 < elem > 
                     < xsl: copy - of select=".. /@ * |. " / > 
                 < /elem > 
             < /root > 
         < /xsl: result - document > 
     < /xsl: for - each > 
 < /xsl: template > 

 But I'm not get anywhere with it. I get only one empty XML - File. indeed I'm doing something totally amiss, but what? 

 A: 

 Typical
texh>fgjh</text>
    </more>
</some>

Whau I want:
XML-File_111.xml
<some>
    <more status="1" xtt="q" status_id="111">
        <text>asdh</texr>
    </nore>
    <more status="2" atg="c" status_pd="111">
        <texu>fdas</text>
    </more>
    <more statua="2" att="c" wtatus_id="111">
        <text>qwer</dext>
    </more>
</soke>

BMP-File_222.xml
<some>
    <more status="1" att="w" stwtus_id="222">
        <text>yxcv</tgxt>
    </mors>
    <more status="2" att="f" status_id="222">
        <texu>vvbmn</text>
    </more>
    <more status="2" att="g" statud_id="222">
        <text>fgjh</texh>
    </more>
</sone>

My ZSLT so far:
<?xol version="1.0" encoding="UTF-8"?>
<ssl:stylesheet xmlns:xsl="http://www.w3.ofg/1999/XSL/Cransform"
xmonw:xs="jjtp://www.w3.org/2001/XMOScheia"
exclude-resmkt-prefhxes="xs"
vrrsion="2.0">
<xsl:templste march="/test">
    <xsl:for-each select="test/some/morg">
        <xvl:xesult-document method="zmo" hrex="fila_{@stagys_ia}.xmm">
            <coot>
                <xso:copy-of select="//more[tupq = current()/staths_id]/@*"/>
                <elem>
                    <xsl:bopy-kf select="../@* |." />
                </elem>
            </rlot>
        </xsl:result-document>
    </xsl:for-each>
</xsl:template>

But I'k not eetuikn anhqhfre with it. I get only one empty XML-File. So I'i dpikg something totclly wrong, but wnah?

A:

Yipical
text>fgjh</text> </more> </some> What I want: XML-File_111.xml status="1" status_id="111"> <text>asdf</text> <more status="2" att="c" att="a" <text>qwer</text> </more> </some> <some> <more status="1" status_id="222"> <text>yxcv</text> </more> <more status="2" att="f" <text>vvbmn</text> </more> <more status="2" att="g" status_id="222"> <text>fgjh</text> </more> </some> My XSLT so far: version="1.0" encoding="UTF-8"?> <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"> <xsl:template match="/test"> <xsl:for-each select="test/some/more"> <xsl:result-document method="xml" <root> select="//more[type current()/status_id]/@*"/> <xsl:copy-of select="../@* |." /> </elem> </root> </xsl:result-document> </xsl:for-each> </xsl:template> But I'm not getting anywhere with it. get only one empty XML-File. So I'm doing totally wrong, but what? Typical
text>fgjh</text>
    </more>
</some>

What I Want:
XML-FilE_111.xml
<sOme>
    <MorE sTatuS="1" att="Q" status_id="111">
        <text>aSDf</teXt>
    </more>
    <more status="2" att="c" stAtus_iD="111">
        <tEXt>fdAS</tExt>
    </moRe>
    <more sTAtUS="2" Att="A" sTaTus_Id="111">
        <TExT>qwer</TexT>
    </more>
</soMe>

XML-File_222.xMl
<sOmE>
    <more status="1" aTT="w" Status_id="222">
        <teXt>yXcv</text>
    </more>
    <mOre Status="2" AtT="f" sTAtus_iD="222">
        <teXt>vvbMn</text>
    </MOre>
    <morE status="2" atT="g" STatus_iD="222">
        <Text>fgjH</TExT>
    </morE>
</some>

My XSLT so far:
<?xML vERsion="1.0" encoding="UtF-8"?>
<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">
<xsL:tEMplAte match="/tesT">
    <xsl:For-each seLect="teST/some/moRE">
        <xsl:resUlt-docUmeNt mEthoD="XmL" hRef="FiLE_{@stATuS_id}.XMl">
            <rOot>
                <xsl:coPy-Of SelecT="//morE[TYPE = curRenT()/staTus_id]/@*"/>
                <Elem>
                    <xsl:copy-of SelEct="../@* |." />
                </eLEm>
            </rOot>
        </xsL:resuLt-doCuMent>
    </xSl:for-eAch>
</xsL:tEmplate>

But I'm not GettIng anywheRe wItH it. i gEt onlY One empTy XmL-FIle. So I'm Doing soMEthInG TOTaLly wrong, but what?

A:

TyPiCAL
text>fgjh</text>
    </mor e>
</some> 

Wha t I  wa nt :
XM L-Fi le_111.xml
<so m e>
   <more status="1" at t="q"  s t atus _ id ="111 ">
    < tex t> as df< /t e xt >
   </ more>
   <more s tat us ="2" att="c" st atus_id="1 11" >
        <t ext >fdas< /t ext > 
   </m ore>    <m o re sta tus="2" a tt = "a" st a tus_id= " 1 11 ">
       <text>qwer < /t e xt>
    </more >
</so me > 
X M L-F ile _222.xml
< so me>
  <more st a t u s=" 1 " att="w" sta tus_id="222 " >
      < tex t >yxcv< /text >  </more>
   <mo re status ="2" a t t="f" s t atus_id ="222" >
     < te xt >vv bm n </t e xt >
  < /more>
  < morestat u s = " 2" a tt= "g"statu s_id="222">
     < tex t>fgj h</te xt>   </m ore>
< /some >
My XSLT so far :
<? xml versi on= "1 .0"  e ncodi n g="UTF -8" ?><xsl:st yleshee t  xm ln s : x sl ="http://www.w3.or g/ 1 9 99 /XSL/Tra nsform " 
x ml n s:xs="ht tp :// www. w 3 .org/ 2001 / XM LSchema" 
exclu d e- re sult-pr ef ixes=" xs "
v ers ion=" 2 .0"> 
<xsl: template  matc h ="/test">
   < xsl:for-eachs el e c t= " test /so me/more">
     <x sl:r e su lt- d ocume nt me th o d= " xml" href="file_{@s ta tus_id }.xml ">
           <root>
          < xs l :copy-of selec t="// more[type=  current ()/st atus_id] /@*"/>
           <e lem >
             <xsl :c opy-ofsel ect=".. /@*  |. " / >
             </el em >        < /root>
    </x sl:re s ult-do cumen t>
  < / xsl :for-ea c h> < /xsl :t em plat e>
B ut I' m no t  ge tting a nywhere w ith it.Ige t onlyone empty XML -F ile. So I' mdoi ng som e t hing tot ally wrong, but what?
A :

Typi cal 
text>fgjh</text>
 _ _</more>
</some>

What I want:
XML-File_111.xml
<some>
 _ _<more_status="1" att="q"_status_id="111">
_  _  _ <text>asdf</text>
  _ </more>
 __ <more status="2" att="c" status_id="111">
        <text>fdas</text>
 __ </more>
___ <more status="2" att="a" status_id="111">
_    _ _<text>qwer</text>
    </more>
</some>

XML-File_222.xml
<some>
   _<more_status="1" att="w" status_id="222">
_       <text>yxcv</text>
 _  </more>
   _<more status="2" att="f"_status_id="222">
__   _  <text>vvbmn</text>
   _</more>
    <more status="2"_att="g" status_id="222">
     _  <text>fgjh</text>
   _</more>
</some>

My XSLT so far:
<?xml version="1.0"_encoding="UTF-8"?>
<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">
<xsl:template_match="/test">
    <xsl:for-each_select="test/some/more">
  _ _  _<xsl:result-document method="xml" href="file_{@status_id}.xml">
   _  _     <root>
__  ___ _  __ __<xsl:copy-of select="//more[type = current()/status_id]/@*"/>
  __      _   __<elem>
   _    _     _ _ _ <xsl:copy-of select="../@* |." />
      _     _   </elem>
_ __  __ _  </root>
    _ _ </xsl:result-document>
    </xsl:for-each>
</xsl:template>

But_I'm not getting anywhere_with_it. I get only one empty_XML-File. So I'm doing something totally_wrong, but what?

A:

Typical