Checking If a Node Exist In an XmlDocument

			
                            Public Function CheckNode(ByRef parentNode As XmlNode, ByRef checkNode As XmlNode) As Boolean
                                Try
                                    Dim xNode As XmlNode
                                    If checkNode Is parentNode Then
                                        Return True
                                    ElseIf parentNode.HasChildNodes Then
                                        For Each xNode In parentNode.ChildNodes
                                            If checkNode Is xNode Then
                                                Return True
                                            Else
                                                If CheckNode(xNode,checkNode) Then
                                                    Return True
                                                End If
                                            End If
                                        Next
                                    Else
                                        Return False
                                    End If
                                    Return False
                                Catch ex As Exception
                                    Throw New Exception(ex.Message & " " & ex.StackTrace)
                                End Try
                           End Function