Below is the XML I have
<TrustFrameworkPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" PolicySchemaVersion="0.3.0.0" TenantId="{Settings:Tenant}" PolicyId="B2C_1A_User_MigrationClients" PublicPolicyUri="http://{Settings:Tenant}/B2C_1A_User_MigrationClients" DeploymentMode="{Settings:DeploymentMode}" UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights">
<BuildModel>
<RestSchema>
<CustType Id="regular.type1">
<DataType>string</DataType>
</CustType>
<CustType Id="regular.type2">
<DataType>string</DataType>
</CustType>
</RestSchema>
</BuildModel>
</TrustFrameworkPolicy>
I have to add new nodes under "RestSchema"
This is how I want to create new
<TrustFrameworkPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" PolicySchemaVersion="0.3.0.0" TenantId="{Settings:Tenant}" PolicyId="B2C_1A_User_MigrationClients" PublicPolicyUri="http://{Settings:Tenant}/B2C_1A_User_MigrationClients" DeploymentMode="{Settings:DeploymentMode}" UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights">
<BuildModel>
<RestSchema>
<CustType Id="regular.type1">
<DataType>string</DataType>
</CustType>
<CustType Id="regular.type2">
<DataType>string</DataType>
</CustType>
<CustType Id="regular.Command-Nest.type1">
<DataType>string</DataType>
</CustType>
<CustType Id="regular.Command-Nest.type2">
<DataType>string</DataType>
</CustType>
</RestSchema>
</BuildModel>
</TrustFrameworkPolicy>
How can I do it using XPATH. I have to create this type of structure in the EXISTING XML under.
I know how to track down to the tag I just need to know how I can create these in java using XPATH.