All,
I'm new to SQL Server. I'm from the Oracle-J2EE camp. I am in the process
of trying
to finalize a good approach. I need to access a SQL Server 2000 D/B from
Java and
do the following...

Select all the Insurance Data processed for the day and convert that into
an XML so that
an application down stream will run XSL to covert it into a format the
vendor needs. (I just
need to generate the xml...)

The basic structure of the xml is as below...

<?xml version="1.0" encoding="UTF-8"?>
<Annuities xmlns="http://ACORD.org/Standards/Life/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ACORD.org/Standards/Life/2
C:\xmlstuff\TXLife2.7.91.xsd">
<Carrier name = "GIECO">
<Policy id="1">
<PolicyDetails>
<PolNumber>TestPol001</PolNumber>
<ProductType tc="9">Fixed Annuity</ProductType>
<IssueType tc="4">Field Issue</IssueType>
<CusipNum>89352F848</CusipNum>
<IssueDate>2003-06-01</IssueDate>
<Funds>
<FinActivityType tc="1">Premium Payment</FinActivityType>
<PaymentForm tc="6">Personal Check</PaymentForm>
<QualPlanType tc="1">Non-Qualified</QualPlanType>
<SourceOfFundsTC tc="1">Cash</SourceOfFundsTC>
<InitDepositAmt>100000.00</InitDepositAmt>
<InitDepositDate>2003-06-01</InitDepositDate>
</Funds>

<ApplicationInfo>
<ApplicationJurisdiction tc="19">Iowa</ApplicationJurisdiction>
<SignedDate>2003-06-01</SignedDate>
<ReplacementInd tc="0">False</ReplacementInd>
</ApplicationInfo>
</PolicyDetails>
<OwnerList>
<Owner id = "1">
<OwnerTypeCode tc="1">Primary</OwnerTypeCode>
<GovtID>123123123</GovtID>
<GovtIDTC tc="1">Social Security Number</GovtIDTC>
<Person>
<FirstName>Roger </FirstName>
<MiddleName>The</MiddleName>
<LastName>Rabbit</LastName>
<Gender tc="1">Male</Gender>
<BirthDate>1961-12-07</BirthDate>
</Person>
<Address>
<AddressTypeCode tc="1">Residence</AddressTypeCode>
<Line1>123 Main Street</Line1>
<City>Grand Rapids</City>
<AddressState>IA</AddressState>
<Zip>52403</Zip>
</Address>
<Phone>
<AreaCode>319</AreaCode>
<DialNumber>377-7798</DialNumber>
</Phone>
<Risk>
<ExistingInsuranceInd tc="0">False</ExistingInsuranceInd>
<ReplacementInd tc="0">False</ReplacementInd>
</Risk>
</Owner>
<Owner id = "2" sameasowner = "true"/>
<Owner id = "3">
<OwnerTypeCode tc="3">Joint</OwnerTypeCode>
<GovtID>123123122</GovtID>
<GovtIDTC tc="1">Social Security Number</GovtIDTC>
<Person>
<FirstName>Martha</FirstName>
<MiddleName>Roger's</MiddleName>
<LastName>Rabbit</LastName>
<Gender tc="1">Female</Gender>
<BirthDate>1967-12-07</BirthDate>
</Person>
<Address>
<AddressTypeCode tc="1">Residence</AddressTypeCode>
<Line1>123 Main Street</Line1>
<City>Grand Rapids</City>
<AddressState>IA</AddressState>
<Zip>52403</Zip>
</Address>
<Phone>
<AreaCode>319</AreaCode>
<DialNumber>377-7798</DialNumber>
</Phone>
<Risk>
<ExistingInsuranceInd tc="0">False</ExistingInsuranceInd>
<ReplacementInd tc="0">False</ReplacementInd>
</Risk>
</Owner>
</OwnerList>
<BeneficiaryList>
<Beneficiary>
<BeneficiaryTypeCode tc="1">Primary</BeneficiaryTypeCode>
<RelationshipToOwner tc="2">Wife</RelationshipToOwner>
<GovtID>122223122</GovtID>
<GovtIDTC tc="1">Social Security Number</GovtIDTC>
<Person>
<FirstName>Bene</FirstName>
<MiddleName>F</MiddleName>
<LastName>Guy</LastName>
<Gender tc="1">Male</Gender>
<BirthDate>1957-12-07</BirthDate>
</Person>
<Address>
<AddressTypeCode tc="1">Residence</AddressTypeCode>
<Line1>13 Villa Street</Line1>
<City>Minneapolis</City>
<AddressState>MN</AddressState>
<Zip>52403</Zip>
</Address>
<Phone>
<AreaCode>723</AreaCode>
<DialNumber>377-7798</DialNumber>
</Phone>
</Beneficiary>
<Beneficiary>
<BeneficiaryTypeCode tc="2">Contingent</BeneficiaryTypeCode>
<RelationshipToOwner tc="3">Brother</RelationshipToOwner>

<GovtID>444223122</GovtID>
<GovtIDTC tc="1">Social Security Number</GovtIDTC>
<Person>
<FirstName>Contingent</FirstName>
<MiddleName>F</MiddleName>
<LastName>Bene</LastName>
<Gender tc="2">Female</Gender>
<BirthDate>1954-11-17</BirthDate>
</Person>
<Address>
<AddressTypeCode tc="2">Office</AddressTypeCode>
<Line1>13 Bertha Ave</Line1>
<City>Minneapolis</City>
<AddressState>MN</AddressState>
<Zip>52403</Zip>
</Address>
<Phone>
<AreaCode>723</AreaCode>
<DialNumber>377-7798</DialNumber>
</Phone>
</Beneficiary>

</BeneficiaryList>

<BankInfo>
<AccountNumber>345667</AccountNumber>
<RoutingNum>ABCDE</RoutingNum>
</BankInfo>


</Policy>

<Policy>
2 nd Annuity ..
</Policy>
</Carrier>
<Carrier name = "AIG">
Not Yet eady for Electronic Transmission.
</Carrier>
<Carrier name = "Nationsbank">
Not Yet eady for Electronic Transmission.
</Carrier>
</Annuities>

My questions are ....

1. "For XML Explicit" adds on to a SQL, but in my scenario a normal SQL
will not suffice. Say i have a customer
C1 in CUSTOMER table and he has 3 Beneficiaries B1,B2,B3 in the beneficiaries
table a SQL join will return
me 3 rows and hence 3 XML nodes. My requirement is to have it as 3
nodes in the cuatomer element. Basically
I'm looking at organizing the day's data by carrier (Ins company) then
by the customer and all the details
pertaining to the customer withing the customer element as above. Will
For XML Explicit suffice ?. From my
initial take it seems difficult ....
2. If I need to code a stored procedure that does a bunch of processing
as required by the above point is there a
way i could convert the same to XML. (Just a reminder, I use Java and
not ASP..)

Any help is greatly appreciated,
Thanks