I have Grafana and postgres installed and connected. I use grafana to display charts of data I add to postgres. My postgres database has a table with records from multiple sources. The schema looks like this:

```
time   | source | bid | ask
12:01  | bitmex | 10  | 11
12:01  | deribit| 10  | 11
12:02  | bitmex | 9   | 11

```

The exact times per source are different. I’m able to plot different lines for every source:

[![enter image description here](https://i.stack.imgur.com/rLc08.png)](https://i.stack.imgur.com/rLc08.png)

I’m looking to plot the difference (grouped per minute) of two different sources. I think I need to select grouped minutes where “source = x” and the same where “source = y” and subtract those, while keeping the time macros from Grafana in there to keep the whole thing speedy. Can anyone point me in the right direction? I don't think this is at all possible with the "graphical query builder" in grafana.
['https://Stackoverflow.com/questions/55123258', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/843033/']
I think you may be having an issue with trying to get the value of the Title tag because you're trying to grab the first attribute of every XML element but the only element that has an attribute is `ArrayOfInternship`.

There are a couple of ways that you could extract all of the titles from all Internship elements in the array.

First would be looping and uses the `XmlDocument` class like what your code uses

```
XmlDocument doc = new XmlDocument();
doc.Load(@"InternList.xml");

// Loop over child nodes of <ArrayOfInternship>...
foreach (XmlNode node in doc.DocumentElement)
{
    // Loop over the child nodes of the <Internship> nodes
    foreach (XmlNode child in node.ChildNodes)
    {
        if (child.Name.Equals("Title", StringComparison.OrdinalIgnoreCase))
        {
            lstBxListIntern.Items.Add(child.InnerText);
        }
    }
}

```

The second solution that I came up with and personally like better because it's more succinct. You probably want to utilize the above solution since you are a beginner and it will most likely be easier for you to read. But here's the other solution using LINQ to XML.

```
XElement xml = XElement.Load(@"InternList.xml");

var titles = xml.Descendants("Title")
    .Select(x => x.Value)
    .ToList();

lstBxListIntern.Items.AddRange(titles);

```

Let me know if you need any clarification on what I mentioned and I'll be happy to clarify.
One possible solution

```
XmlDocument xmldocIntern = new XmlDocument();
xmldocIntern.Load(@"InternList.xml");

var oc = new ListBox.ObjectCollection(lstBxListIntern, xmldocIntern.DocumentElement.GetElementsByTagName("Title").Cast<XmlNode>().Select(node => node.InnerText).ToArray());

```