wonderful, this worked like a charm...thank you Arjay...

Quote Originally Posted by Arjay View Post
Create some serialization classes:
Code:
    using System.Xml.Serialization;
    using System.IO;
    using System.Collections.Generic;
        
    [XmlType(AnonymousType=true, Namespace="http://schemas.datacontract.org/2004/07/test.tester.UserInfo")]
    [XmlRoot(Namespace="http://schemas.datacontract.org/2004/07/test.tester.UserInfo", IsNullable=false)]
    public class Employee
    {
        public static Employee FromXml( string xml )
        {
            var serializer = new XmlSerializer( typeof( Employee ) );

            using ( var reader = new StringReader( xml ) )
            {
                return ( Employee ) serializer.Deserialize( reader );
            }
        }
        
        /// <remarks/>
        [XmlElement("KeyValueOfstringstring", Namespace="http://schemas.microsoft.com/2003/10/serialization/arrays")]
        public KeyValue [ ] KeyValues
        {
            get
            {
                if ( _keyValueList == null ) _keyValueList = new List<KeyValue>( );
                return _keyValueList.ToArray( );
            }
            set
            {
                if ( _keyValueList == null ) _keyValueList = new List<KeyValue>( );

                if ( value != null ) _keyValueList.AddRange( value );
            }
        }

        private List<KeyValue> _keyValueList = new List< KeyValue >();
    }
    
    public partial class KeyValue
    {

        /// <remarks/>
        [XmlElement( "Key" )]
        public string Key { get; set; }
        
        /// <remarks/>
        [XmlElement( "Value" )]
        public string Value { get; set; }
    }


Load the xml up using the serialization classes. Note: I'm using an XmlDocument to read the xml from file. This just makes it easier to test - the FromXml method takes raw xml string.
Code:
// use an xml document to load the xml snippet for convenience
var xmlDoc = new XmlDocument();
xmlDoc.Load( "Employee.xml" );

// Deserialize the xml
var employee = CG.Employee.FromXml(xmlDoc.InnerXml);

// Cycle through the key value pairs
foreach( var kv in employee.KeyValues )
{
  Console.WriteLine( String.Format( "Key: {0}", kv.Key ) );
  Console.WriteLine( String.Format( "Value: {0}\n", kv.Value ) );
}
If you have control over the xml schema, you might want to revise it into something a bit more compact (i.e use attributes instead of elements and shorter names).