EDIT -
I figured out a solution to my problem and posted a Q & A here.
I'm looking for XML processing that conforms to the EAD standard of the Library of Congress (found here ). Unfortunately, the standard is very loose regarding the XML structure.
For example, a tag <bioghist>may exist in a tag <archdesc>or in a tag <descgrp>, or nested in another tag <bioghist>, or in combination with the above, or may be completely excluded. I found that it is very difficult to select only the bioghist tag that I am looking for without selecting others.
Below are a few of the various possible EAD XML documents that XSLT can handle:
First example
<ead>
<eadheader>
<archdesc>
<bioghist>one</bioghist>
<dsc>
<c01>
<descgrp>
<bioghist>two</bioghist>
</descgrp>
<c02>
<descgrp>
<bioghist>
<bioghist>three</bioghist>
</bioghist>
</descgrp>
</c02>
</c01>
</dsc>
</archdesc>
</eadheader>
</ead>
Second example
<ead>
<eadheader>
<archdesc>
<descgrp>
<bioghist>
<bioghist>one</bioghist>
</bioghist>
</descgrp>
<dsc>
<c01>
<c02>
<descgrp>
<bioghist>three</bioghist>
</descgrp>
</c02>
<bioghist>two</bioghist>
</c01>
</dsc>
</archdesc>
</eadheader>
</ead>
Third example
<ead>
<eadheader>
<archdesc>
<descgrp>
<bioghist>one</bioghist>
</descgrp>
<dsc>
<c01>
<c02>
<bioghist>three</bioghist>
</c02>
</c01>
</dsc>
</archdesc>
</eadheader>
</ead>
, XML EAD <bioghist> . , , . EAD :
<records>
<primary_record>
<biography_history>first</biography_history>
</primary_record>
<child_record>
<biography_history>second</biography_history>
</child_record>
<granchild_record>
<biography_history>third</biography_history>
</granchild_record>
</records>
<records>
<primary_record>
<biography_history>first</biography_history>
</primary_record>
<child_record>
<biography_history>second</biography_history>
</child_record>
<granchild_record>
<biography_history>third</biography_history>
</granchild_record>
</records>
<records>
<primary_record>
<biography_history>first</biography_history>
</primary_record>
<child_record>
<biography_history></biography_history>
</child_record>
<granchild_record>
<biography_history>third</biography_history>
</granchild_record>
</records>
"" <primary_record>, <xsl:apply-templates select="/ead/eadheader/archdesc/bioghist", <archdesc>. <descgrp> <bioghist> . select="//bioghist", <bioghist>. select="//bioghist[1]", <bioghist>, <c01>, "" .
, , <cxx>, . . node, (<c01> ) "RN", <xsl:apply-templates select=".//bioghist [name(..)=name($RN) or name(../..)=name($RN)]">. EAD, <bioghist> , , - EAD, -, ( EAD).
, -
<bioghist> - node,- ,
<c??>
, . , , - . , , . .