Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7648101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:37:44+00:00 2026-05-31T10:37:44+00:00

I’m new to XML and am having a problem understanding how to implement a

  • 0

I’m new to XML and am having a problem understanding how to implement a solution of deleting certain elements within the tree. I’ve searched for a solution and have tried numerous examples, but have not generated anything that satisfies me. Hoping that someone may shed some light. Probably real simply, but I’m missing it since I’m just starting with XML.

A sample XML would be:

<?xml version="1.0"?>
    <configuration>
      <configSections>
        <sectionGroup name="system.sm">
          <section name="domainServices" type="System.sm.DomainServices.Hosting.DomainServicesSection, System.sm.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" allowDefinition="MachineTABCplication" requirePermission="false" />
        </sectionGroup>
      </configSections>
      <appSettings>
        <add key="useRemote" value="false" />
        <add key="sandboxFolder" value="D:\Sandbox" />
        <add key="imageFilesFolder" value="Images" />
      </appSettings>
      <runtime>
        <assemblylock xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="Platform/bin;ProductBin" />
        </assemblylock>
      </runtime>
      <connectionStrings>
        <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
      </connectionStrings>
      <system.web>
        <httpModules>
          <add name="DomainServiceModule" type="System.sm.DomainServices.Hosting.DomainServiceHttpModule, System.sm.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </httpModules>
        <compilation debug="true" targetFramework="4.0" />
        <globalization culture="auto" uiCulture="auto" />
        <authentication mode="Forms">
          <forms protection="All" />
        </authentication>
        <roleManager enabled="true">
        </roleManager>
        <profile>
          <providers>
            <clear />
            <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
          </providers>
          <properties>
            <add name="FriendlyName" />
          </properties>
        </profile>
        <httpRuntime maxRequestLength="10240" />
      </system.web>
      <system.ws>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
          <add name="DomainServiceModule" preCondition="managedHandler" type="System.sm.DomainServices.Hosting.DomainServiceHttpModule, System.sm.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </modules>
      </system.ws>
      <system.sm>
        <client>
          <endpoint address="net.tcp://localhost:5256/HTM" lock="netTcplock" lockConfiguration="NetTcplock_Service" contract="ProductHFSReference.Service" name="NetTcplock_Service" />
          <endpoint address="http://localhost:5255/HTM/basic" lock="basicHttplock" lockConfiguration="BasicHttplock_Service" contract="ProductHFSReference.Service" name="BasicHttplock_Service" />
          <endpoint address="http://localhost:5255/HTM/ws" lock="wsHttplock" lockConfiguration="WSHttplock_Service1" contract="ProductHFSReference.Service" name="WSHttplock_Service1" />
          <endpoint address="http://localhost:5255/DManager/ws" lock="wsHttplock" lockConfiguration="WSHttplock_IDevicePool" contract="DManagerServiceReference.IDevicePool" name="WSHttplock_IDevicePool">
            <deleteme>
              <userName value="Jack" />
            </deleteme>
          </endpoint>
          <endpoint address="net.tcp://localhost:5256/DManager" lock="netTcplock" lockConfiguration="NetTcplock_IDevicePool" contract="DManagerServiceReference.IDevicePool" name="NetTcplock_IDevicePool">
            <deleteme>
              <userName value="Jill" />
            </deleteme>
          </endpoint>
        </client>
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
            <!-- Enable the serializer to serialize greater number of records -->
            <behavior name="SilverlightWCFLargeDataApplication.Web.SilverlightWCFServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <locks>
          <basicHttplock>
            <lock name="BasicHttplock_IApplication" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="524288" maxBufferPoolSize="524288" maxReceivedMessageSize="524288" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </lock>
            <lock name="BasicHttplock_ILicenseManagerService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </lock>
          </basicHttplock>
          <customlock>
            <lock name="ProductWebApp.Web.Services.positionPreviewSvc.customlock0">
              <binaryMessageEncoding maxReadPoolSize="2147483647" maxWritePoolSize="2147483647" maxSessionSize="2147483647">
                <readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="200000" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              </binaryMessageEncoding>
              <httpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
            </lock>
          </customlock>
          <netTcplock>
            <lock name="NetTcplock_IDevicePool" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
              <security mode="Transport">
                <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                <message clientCredentialType="Windows" />
              </security>
            </lock>
            <lock name="NetTcplock_Service" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
              <security mode="Transport">
                <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                <message clientCredentialType="Windows" />
              </security>
            </lock>
            <lock name="NetTcplock_IProductAppSvc" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
              <security mode="Transport">
                <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                <message clientCredentialType="Windows" />
              </security>
            </lock>
            </lock>
          </netTcplock>
          <wsHttplock>
            <lock name="WSHttplock_Service" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
              <security mode="Message">
                <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
              </security>
            </lock>
          </wsHttplock>
        </locks>
        <services>
          <service name="ProductWebApp.Web.Services.positionPreviewSvc">
            <endpoint address="" lock="customlock" lockConfiguration="ProductWebApp.Web.Services.positionPreviewSvc.customlock0" contract="ProductWebApp.Web.Services.positionPreviewSvc" />
            <endpoint address="mex" lock="mexHttplock" contract="IMetadataExchange" />
          </service>
          <service name="ProductWebApp.Web.Services.positionPresetSvc">
            <endpoint address="" lock="customlock" lockConfiguration="ProductWebApp.Web.Services.positionPresetSvc.customlock0" contract="ProductWebApp.Web.Services.positionPresetSvc" />
            <endpoint address="mex" lock="mexHttplock" contract="IMetadataExchange" />
          </service>
          <service name="ProductWebApp.Web.Services.ProductSvc">
            <endpoint address="" lock="customlock" lockConfiguration="ProductWebApp.Web.Services.ProductSvc.customlock0" contract="ProductWebApp.Web.Services.ProductSvc" />
            <endpoint address="mex" lock="mexHttplock" contract="IMetadataExchange" />
          </service>
        </services>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSitelocksEnabled="true" />
      </system.sm>
    </configuration>

I’m trying to go through the XML and remove all instances of the element <deleteme>.

I’ve tried looping through XmlNodes to obtain any childnodes with name equal to “deleteme” then call the removeall(). This removes everything except the <deleteme></deleteme> tags. What would I need to do the remove <deleteme></deleteme> entirely?

Thanks in advance for your time and guidance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:37:46+00:00Added an answer on May 31, 2026 at 10:37 am

    If you have found the node to remove use this call:

    node.ParentNode.RemoveChild(node);
    

    That will bring you back to the parent and then remove the entire node(including the tags)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.