title: Representing a graph in XML
body: <p>Hi what will the best possible way to represent a graph in XML, where a node can be the child of a parent node and may be the parent of another child node. It can refer to itself, and multiple nodes can have same parent. And a node can have multiple parents. 
  All nodes are from same class. I want to build it efficiently, so that if I can learn about a child node from a parent node I can go to the specific child tag without having to iterate all the nodes. Is it possible?
  for example here is an overview,</p>
  
  <pre><code>A-&gt;B,C,D
  
  B-&gt;C,D
  </code></pre>
  
  <p>it may look like </p>
  
  <pre><code>&lt;Node name=A&gt;
   &lt;childNode name=B&gt;
   &lt;childNode name=C&gt;
   &lt;childNode name=D&gt;
  &lt;/Node&gt;
  
  &lt;Node name=B&gt;
   &lt;childNode name=C&gt;
   &lt;childNode name=D&gt;
  &lt;/Node&gt;
  </code></pre>
  
  <p>So are there any better approaches than this? Whenever I get a child from A i.e. B, than I will have to basically iterate through all Nodes and match there name attribute with B to find the Node that represents B. Can I somehow do it faster?</p>