title: Better way to detect XML?
body: <p>Currently, I have the following c# code to extract a value out of text.  If its XML, I want the value within it - otherwise, if its not XML, it can just return the text itself.</p>
  
  <pre><code>String data = "..."
  try
  {
      return XElement.Parse(data).Value;
  }
  catch (System.Xml.XmlException)
  {
      return data;
  }
  </code></pre>
  
  <p>I know exceptions are expensive in C#, so I was wondering if there was a better way to determine if the text I'm dealing with is xml or not?</p>
  
  <p>I thought of regex testing, but I dont' see that as a cheaper alternative.  Note, I'm asking for a <em>less expensive</em> method of doing this.</p>