I've the following xml,
<?xml version="1.0" encoding="utf-8"?>
<NewDataSet xmlns="www.asdsad.com/sdsad">
<Balances>
<AccountNumber>KK-888</AccountNumber>
<SubAccountNumber>KK-888-1</SubAccountNumber>
<TAcctID>1</TAcctID>
<TransactionAccount>ARC Deposit</TransactionAccount>
<Description />
<Balance>0.0000</Balance>
</Balances>
<Balances>
<AccountNumber>KK-888</AccountNumber>
<SubAccountNumber>KK-888-2</SubAccountNumber>
<TAcctID>2</TAcctID>
<TransactionAccount>Assessments and Dues</TransactionAccount>
<Description>This is the primary account for all associations dues and assessments. </Description>
<Balance>170</Balance>
</Balances>
<Balances>
<AccountNumber>KK-888</AccountNumber>
<SubAccountNumber>KK-888-4</SubAccountNumber>
<TAcctID>4</TAcctID>
<TransactionAccount>Fines/Compliance</TransactionAccount>
<Description />
<Balance>0.0000</Balance>
</Balances>
</NewDataSet>
I need this result xml from above through xslt,
<balance amount="170" />
I'll pass the SubAccountNumber to the xslt and I need the particular Balances/Balance amount. In the above example I've passed the SubAccountNumber value as "KC1-0221-2" so the second Balances node is matched and it's Balance value is "170". Can anyone help me to write the xslt for that. (Note: only one node will match the passed SubAccountNumber).
UPDATED I've no problem if I can produce the xml with a root node,
<account>
<balance amount="170" />
</account>