In XSLT I often match nodes using the following command
<xsl:template match="*[local-name() = 'Proposal']/*[local-name() = 'ApplicationData']">
which would get the nodes from
<?xml version="1.0" encoding="utf-8"?><?xfa generator="XFA2_4" APIVersion="2.8.9029.0"?>
<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" timeStamp="2013-03-01T09:48:58Z" uuid="3e3468da-104d-4532-8077-0dc001ca166b">
<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
<xfa:data>
<Proposal xmlns="http://www.govtalk.gov.uk/planning/OneAppProposal-2006" Version="">
<oneapp:ApplicationData xmlns:oneapp="http://www.govtalk.gov.uk/planning/OneAppProposal-2006">
<oneapp:TreesHedgesWales/>
<oneapp:OtherLowCarbonEnergy/>
</oneapp:ApplicationData>
</Proposal>
...
matching
<oneapp:ApplicationData xmlns:oneapp="http://www.govtalk.gov.uk/planning/OneAppProposal-2006">
<oneapp:TreesHedgesWales/>
<oneapp:OtherLowCarbonEnergy/>
</oneapp:ApplicationData>
How could I determine whether ApplicationData
existed, and if not, insert it?