Splitting XML file using C#

Splitting XML file  for External and Internal
<APExport>
	<BatchID>17468</BatchID>
	<PayablePO>
		<SummaryInfo>
			<ReqNumber>229284</ReqNumber>
			<PONumber>TEST238254</PONumber>
			<PODate dateString="Thu, 2 Oct 2008 11:50:48 UTC">
				<Year>2008</Year>
				<Month>10</Month>
				<Day>2</Day>
				<Hour24>11</Hour24>
				<Minute>50</Minute>
				<Second>48</Second>
			</PODate>
			<ShipTo>
				<Name>Lorna Reid</Name>
				<UserID>wlclornar</UserID>
				<TaxAuthority/>
				<TaxRateType/>
				<OrgUnits>
					<Org Level="1">
						<Label>Level One</Label>
						<Name>Councils</Name>
						<Code>SCCO</Code>
					</Org>
					<Org Level="2">
						<Label>Council</Label>
						<Name>Council</Name>
						<Code>WLC</Code>
					</Org>
					<Org Level="3">
						<Label>Corporate</Label>
						<Name>Executive Services</Name>
						<Code>WLCES</Code>
					</Org>
					<Org Level="4">
						<Label>Service Section</Label>
						<Name>Finance</Name>
						<Code>WLCFIN</Code>
					</Org>
					<Org Level="5">
						<Label>Service Areas</Label>
						<Name>Financial Management</Name>
						<Code>FINMGMT</Code>
					</Org>
				</OrgUnits>
			</ShipTo>
			<BillTo>
				<Name>Lorn</Name>
				<UserID>wlclornar</UserID>
				<OrgUnits>
					<Org Level="1">
						<Label>Level One</Label>
						<Name>Councils</Name>
						<Code>SCCO</Code>
					</Org>
					<Org Level="2">
						<Label>Council</Label>
						<Name>Council</Name>
						<Code>WLC</Code>
					</Org>
					<Org Level="3">
						<Label>Corporate</Label>
						<Name>Executive Services</Name>
						<Code>WLCES</Code>
					</Org>
					<Org Level="4">
						<Label>Service Section</Label>
						<Name>Finance</Name>
						<Code>WLCFIN</Code>
					</Org>
					<Org Level="5">
						<Label>Service Areas</Label>
						<Name>Financial Management</Name>
						<Code>FINMGMT</Code>
					</Org>
				</OrgUnits>
			</BillTo>
		</SummaryInfo>
		<Invoice>
			<InvoiceNumber>WLC238254-1144502</InvoiceNumber>
			<InvoiceDate dateString="Wed, 1 Oct 2008 23:00:00 UTC">
				<Year>2008</Year>
				<Month>10</Month>
				<Day>1</Day>
				<Hour24>23</Hour24>
				<Minute>0</Minute>
				<Second>0</Second>
			</InvoiceDate>
			<DebitCredit>DI</DebitCredit>
			<Comments/>
			<User>
				<Name>Lorna</Name>
				<UserID>wlclornar</UserID>
				<OrgUnits>
					<Org Level="1">
						<Label>Level One</Label>
						<Name>Councils</Name>
						<Code>CCO</Code>
					</Org>
					<Org Level="2">
						<Label>Council</Label>
						<Name>Council</Name>
						<Code>C</Code>
					</Org>
					<Org Level="3">
						<Label>Corporate</Label>
						<Name>Executive Services</Name>
						<Code>CES</Code>
					</Org>
					<Org Level="4">
						<Label>Service Section</Label>
						<Name>Finance</Name>
						<Code>FIN</Code>
					</Org>
					<Org Level="5">
						<Label>Service Areas</Label>
						<Name>Financial Management</Name>
						<Code>FINMGMT</Code>
					</Org>
				</OrgUnits>
				<Phone>
					<TelephoneNumber>
						<Number>01506 777052</Number>
					</TelephoneNumber>
					<FaxNumber>
						<Number>01506 777035</Number>
					</FaxNumber>
				</Phone>
				<Email>pecosmails@elcom.com</Email>
			</User>
			<SupplierName>Inprint (INTERNAL)</SupplierName>
			<RemitAddress>
				<Street>Inprint, Council</Street>
				<Street>WhiteHouse, 7 Whitestone Place</Street>
				<Street>WhiteHouse Industrial Estate</Street>
				<City>WhiteHouse</City>
				<State>Here</State>
				<PostalCode>AA48 2HA</PostalCode>
				<Country>GB</Country>
				<AddressKey>WLC Inprint (INTERNAL)</AddressKey>
			</RemitAddress>
			<SupplierNumber>INT001</SupplierNumber>
			<SupplierTaxID/>
			<PaymentTerms>Not Selected</PaymentTerms>
			<InvoiceTotal Locale="2057">
				<TotalAmount>80.00</TotalAmount>
				<CurrencyCode>GBP</CurrencyCode>
				<InvoiceAccounting>Header Level Accounting</InvoiceAccounting>
				<Accounting>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>1</SegmentPos>
						<SegmentName>Cost Centre</SegmentName>
						<AccountCode>14286</AccountCode>
						<Amount>80.00</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>2</SegmentPos>
						<SegmentName>Account Code</SegmentName>
						<AccountCode>410300</AccountCode>
						<Amount>80.00</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>3</SegmentPos>
						<SegmentName>Unit Code</SegmentName>
						<AccountCode>0000</AccountCode>
						<Amount>80.00</Amount>
					</Split>
				</Accounting>
				<Tax>
					<Amount>0.00</Amount>
				</Tax>
				<Shipping>
					<Amount>0.00</Amount>
				</Shipping>
				<Vat Type="Total">
					<Amount>0.00</Amount>
					<Rate>0.00</Rate>
				</Vat>
				<TaxRoundingVariance>14.00</TaxRoundingVariance>
				<ShortPayAmount>80.00</ShortPayAmount>
			</InvoiceTotal>
			<Origin>R</Origin>
			<Line>
				<LineNumber>1</LineNumber>
				<ItemNumber>unknown</ItemNumber>
				<Description>Business Cards for Merle Stevenson</Description>
				<Quantity>1</Quantity>
				<UnitPrice>80.00</UnitPrice>
				<ExtendedPrice>80.00</ExtendedPrice>
				<Vat Type="Standard Rated (17.5%)">
					<Amount>14.00</Amount>
					<Rate>0.1750</Rate>
					<Description>Standard Rated (17.5%)</Description>
				</Vat>
				<Accounting>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>1</SegmentPos>
						<SegmentName>Cost Centre</SegmentName>
						<AccountCode>14286</AccountCode>
						<Amount>80.00</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>2</SegmentPos>
						<SegmentName>Account Code</SegmentName>
						<AccountCode>410300</AccountCode>
						<Amount>80.00</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>3</SegmentPos>
						<SegmentName>Unit Code</SegmentName>
						<AccountCode>0000</AccountCode>
						<Amount>80.00</Amount>
					</Split>
				</Accounting>
				<UnitOfMeasure>EA</UnitOfMeasure>
				<SettlementType>qty</SettlementType>
			</Line>
			<InvoiceID>696167</InvoiceID>
		</Invoice>
		<Variance>
			<CurrencyCode>GBP</CurrencyCode>
			<NetOrderVariance>0.00</NetOrderVariance>
			<TotalOrderVariance>0.00</TotalOrderVariance>
		</Variance>
	</PayablePO>
	<PayablePO>
		<SummaryInfo>
			<ReqNumber>229285</ReqNumber>
			<PONumber>TEST238255</PONumber>
			<PODate dateString="Thu, 2 Oct 2008 11:51:10 UTC">
				<Year>2008</Year>
				<Month>10</Month>
				<Day>2</Day>
				<Hour24>11</Hour24>
				<Minute>51</Minute>
				<Second>10</Second>
			</PODate>
			<ShipTo>
				<Name>Lorna Reid</Name>
				<UserID>wlclornar</UserID>
				<TaxAuthority/>
				<TaxRateType/>
				<OrgUnits>
					<Org Level="1">
						<Label>Level One</Label>
						<Name>Councils</Name>
						<Code>SCCO</Code>
					</Org>
					<Org Level="2">
						<Label>Council</Label>
						<Name> Council</Name>
						<Code>CCC</Code>
					</Org>
					<Org Level="3">
						<Label>Corporate</Label>
						<Name>Executive Services</Name>
						<Code>CES</Code>
					</Org>
					<Org Level="4">
						<Label>Service Section</Label>
						<Name>Finance</Name>
						<Code>FIN</Code>
					</Org>
					<Org Level="5">
						<Label>Service Areas</Label>
						<Name>Financial Management</Name>
						<Code>FINMGMT</Code>
					</Org>
				</OrgUnits>
			</ShipTo>
			<BillTo>
				<Name>Lorna Reid</Name>
				<UserID>wlclornar</UserID>
				<OrgUnits>
					<Org Level="1">
						<Label>Level One</Label>
						<Name>Councils</Name>
						<Code>CCC</Code>
					</Org>
					<Org Level="2">
						<Label>Council</Label>
						<Name>Council</Name>
						<Code>WLC</Code>
					</Org>
					<Org Level="3">
						<Label>Corporate</Label>
						<Name>Executive Services</Name>
						<Code>CES</Code>
					</Org>
					<Org Level="4">
						<Label>Service Section</Label>
						<Name>Finance</Name>
						<Code>FIN</Code>
					</Org>
					<Org Level="5">
						<Label>Service Areas</Label>
						<Name>Financial Management</Name>
						<Code>FINMGMT</Code>
					</Org>
				</OrgUnits>
			</BillTo>
		</SummaryInfo>
		<Invoice>
			<InvoiceNumber>zzz238255</InvoiceNumber>
			<InvoiceDate dateString="Wed, 1 Oct 2008 23:00:00 UTC">
				<Year>2008</Year>
				<Month>10</Month>
				<Day>1</Day>
				<Hour24>23</Hour24>
				<Minute>0</Minute>
				<Second>0</Second>
			</InvoiceDate>
			<DebitCredit>DI</DebitCredit>
			<Comments/>
			<User>
				<Name>Lorna Reid</Name>
				<UserID>wlclornar</UserID>
				<OrgUnits>
					<Org Level="1">
						<Label>Level One</Label>
						<Name>Councils</Name>
						<Code>SCCO</Code>
					</Org>
					<Org Level="2">
						<Label>Council</Label>
						<Name>Council</Name>
						<Code>CCC</Code>
					</Org>
					<Org Level="3">
						<Label>Corporate</Label>
						<Name>Executive Services</Name>
						<Code>CES</Code>
					</Org>
					<Org Level="4">
						<Label>Service Section</Label>
						<Name>Finance</Name>
						<Code>FIN</Code>
					</Org>
					<Org Level="5">
						<Label>Service Areas</Label>
						<Name>Financial Management</Name>
						<Code>FINMGMT</Code>
					</Org>
				</OrgUnits>
				<Phone>
					<TelephoneNumber>
						<Number>01506 777052</Number>
					</TelephoneNumber>
					<FaxNumber>
						<Number>01506 777035</Number>
					</FaxNumber>
				</Phone>
				<Email>pecosmails@elcom.com</Email>
			</User>
			<SupplierName>A G Barr Soft Drinks</SupplierName>
			<RemitAddress>
				<Street>4  Mollins Road</Street>
				<Street>Westfield Industrial Estate</Street>
				<City>CUMBERNAULD</City>
				<PostalCode>G68  9HD</PostalCode>
				<Country>GB</Country>
				<AddressKey>WLC A G Barr Soft Drinks</AddressKey>
			</RemitAddress>
			<SupplierNumber>999999</SupplierNumber>
			<SupplierTaxID/>
			<PaymentTerms>N30</PaymentTerms>
			<InvoiceTotal Locale="2057">
				<TotalAmount>23.38</TotalAmount>
				<CurrencyCode>GBP</CurrencyCode>
				<InvoiceAccounting>Header Level Accounting</InvoiceAccounting>
				<Accounting>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>1</SegmentPos>
						<SegmentName>Cost Centre</SegmentName>
						<AccountCode>14280</AccountCode>
						<Amount>19.90</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>2</SegmentPos>
						<SegmentName>Account Code</SegmentName>
						<AccountCode>410300</AccountCode>
						<Amount>19.90</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>3</SegmentPos>
						<SegmentName>Unit Code</SegmentName>
						<AccountCode>0000</AccountCode>
						<Amount>19.90</Amount>
					</Split>
				</Accounting>
				<Tax>
					<Amount>0.00</Amount>
				</Tax>
				<Shipping>
					<Amount>0.00</Amount>
				</Shipping>
				<Vat Type="Total">
					<Amount>3.48</Amount>
					<Rate>0.00</Rate>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>1</SegmentPos>
						<SegmentName>Cost Centre</SegmentName>
						<AccountCode>14280</AccountCode>
						<Amount>3.48</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>2</SegmentPos>
						<SegmentName>Account Code</SegmentName>
						<AccountCode>410300</AccountCode>
						<Amount>3.48</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>3</SegmentPos>
						<SegmentName>Unit Code</SegmentName>
						<AccountCode>0000</AccountCode>
						<Amount>3.48</Amount>
					</Split>
				</Vat>
				<TaxRoundingVariance>0.00</TaxRoundingVariance>
				<ShortPayAmount>23.38</ShortPayAmount>
			</InvoiceTotal>
			<Origin>S</Origin>
			<Line>
				<LineNumber>1</LineNumber>
				<ItemNumber>402600</ItemNumber>
				<Description>BARR'S ST CLEMENTS PURE JUICE Orange - 330ml PET - Case of 6</Description>
				<Quantity>10</Quantity>
				<UnitPrice>1.99</UnitPrice>
				<ExtendedPrice>19.90</ExtendedPrice>
				<Vat Type="Standard Rated (17.5%)">
					<Amount>3.48</Amount>
					<Rate>0.1750</Rate>
					<Description>Standard Rated (17.5%)</Description>
				</Vat>
				<Accounting>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>1</SegmentPos>
						<SegmentName>Cost Centre</SegmentName>
						<AccountCode>14280</AccountCode>
						<Amount>19.90</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>2</SegmentPos>
						<SegmentName>Account Code</SegmentName>
						<AccountCode>410300</AccountCode>
						<Amount>19.90</Amount>
					</Split>
					<Split>
						<Sequence>0</Sequence>
						<SegmentPos>3</SegmentPos>
						<SegmentName>Unit Code</SegmentName>
						<AccountCode>0000</AccountCode>
						<Amount>19.90</Amount>
					</Split>
				</Accounting>
				<UnitOfMeasure>CA</UnitOfMeasure>
				<SettlementType>qty</SettlementType>
			</Line>
			<InvoiceID>696168</InvoiceID>
		</Invoice>
		<Variance>
			<CurrencyCode>GBP</CurrencyCode>
			<NetOrderVariance>0.00</NetOrderVariance>
			<TotalOrderVariance>3.48</TotalOrderVariance>
		</Variance>
	</PayablePO>
	<BatchInfo>
		<BatchID>17468</BatchID>
		<Date dateString="Thu, 2 Oct 2008 11:54:37 UTC">
			<Year>2008</Year>
			<Month>10</Month>
			<Day>2</Day>
			<Hour24>11</Hour24>
			<Minute>54</Minute>
			<Second>37</Second>
		</Date>
		<NumberOfPOs>2</NumberOfPOs>
		<NumberOfInvoices>2</NumberOfInvoices>
		<BatchTotal>
			<Money currency="GBP">103.38</Money>
		</BatchTotal>
	</BatchInfo>
</APExport>

Open in new window

wilgorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DarrenSenior Software EngineerCommented:
Hi,

What exactly do you want to do with your XMl file?

Darren
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wilgorAuthor Commented:
This worked fine thanks very much for your help
0
wilgorAuthor Commented:
Thanks for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.