title: How can I create a generic constructor? (ie. BaseClass.FromXml(<param>)
body: <p>I'm not sure how to describe this but I'm trying to create a base class that contains a shared (factory) function called FromXml.  I want this function to instantiate an object of the <strong>proper type</strong> and then fill it via an XmlDocument.</p>
  
  <p>For example, let's say I have something like this:</p>
  
  <pre><code>Public Class XmlObject
      Public Shared Function FromXml(ByVal source as XmlDocument) As XmlObject
          // &lt;need code to create SPECIFIC TYPE of object and return it
      End Function
  End Class
  
  Public Class CustomObject
      Inherits XmlObject
  End Class
  </code></pre>
  
  <p>I'd like to be able to do something like this:</p>
  
  <pre><code>Dim myObject As CustomObject = CustomObject.FromXml(source)
  </code></pre>
  
  <p>Is this possible?</p>